Drag and Drop with Sikuli

I'm 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.

It looks like it should work:

t = find("1325249963143.png") dragDrop(t, [tx + 100, ty + 100]) 

IDE Sikuli magazine says

 [log] DRAG (741,525) to null 

but the item is not being dragged.

This works great:

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

The magazine 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)

+4
source share
3 answers

just to say hello here - alternative coding:

 dragDrop(t, t.offset(Location(100, 100))) 
+10
source

In quote RaiMan (raimund-hocke) :

The first parameter is the match object, which is fine. the second prameter must also be of type PSMRL (see docs: Pattern / Image, String, Match, region or location)

 dragDrop(t, Location(tx + 100, ty + 100)) 
+8
source

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

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

Source: https://habr.com/ru/post/1388608/


All Articles