使用 Sikuli 进行拖放

发布于 2024-12-23 11:56:29 字数 502 浏览 7 评论 0原文

我在使用 Sikuli 拖放时遇到问题。我想在任何其他方向(上、下、左、右)拖动某些东西固定数量的像素。

这看起来应该可以工作:

t = find("1325249963143.png")
dragDrop(t, [t.x + 100, t.y + 100])

Sikuli IDE 日志显示

[log] DRAG (741,525) to null

,但该元素未被拖动。

这工作得很好:

dragDrop("1325249963143.png", "1325251471990.png")

日志显示

[log] DRAG (741,525) to (507,490)

我做错了什么?

环境:Mac OS X 10.7.2、Sikuli X-1.0rc3 (r905)

I am having trouble using drag and drop with Sikuli. I would like to drag something in any other direction (up, down, left, right) for a fixed number of pixels.

This looks like it should work:

t = find("1325249963143.png")
dragDrop(t, [t.x + 100, t.y + 100])

Sikuli IDE log says

[log] DRAG (741,525) to null

but the element is not dragged.

This works just fine:

dragDrop("1325249963143.png", "1325251471990.png")

The log says

[log] DRAG (741,525) to (507,490)

What am I doing wrong?

Environment: Mac OS X 10.7.2, Sikuli X-1.0rc3 (r905)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

丘比特射中我 2024-12-30 11:56:29

只是在这里打个招呼 - 另一种编码:

dragDrop(t, t.offset(Location(100, 100)))

only to say hello here - an alternative coding:

dragDrop(t, t.offset(Location(100, 100)))
意中人 2024-12-30 11:56:29

引用 RaiMan (raimund-hocke)

第一个参数是一个Match对象,这样就可以了。第二个
prameter 也必须是 PSMRL 类型(请参阅文档:Pattern/Image、String、
匹配、区域或位置)

dragDrop(t, Location(t.x + 100, t.y + 100))

To quote RaiMan (raimund-hocke):

the first parameter is a Match object, which is ok. the second
prameter must be of type PSMRL too (see docs: Pattern/Image, String,
Match, Region or Location)

dragDrop(t, Location(t.x + 100, t.y + 100))
软的没边 2024-12-30 11:56:29

我使用此代码将图像拖动到给定位置:

image1 = ("image1.png")
imageLoc = find(image1)
dragDrop(imageLoc, Location(imageLoc.getX() + 100, imageLoc.getY() + 100))

I use this code to drag an image down to a given location:

image1 = ("image1.png")
imageLoc = find(image1)
dragDrop(imageLoc, Location(imageLoc.getX() + 100, imageLoc.getY() + 100))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文