RC3 drag and drop sliders function not working

Asked by na

This code works fine on RC2 but it does not work in RC3 ... any idea why?

  t = .inside(addregionimage).find(addsliderbuttonimage)
  dragDrop(t, [t.x -100, t.y ])

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
na
Solved:
Last query:
Last reply:
Revision history for this message
na (dirkgb30) said :
#1

no comments

Revision history for this message
na (dirkgb30) said :
#2

fixed

Revision history for this message
Željko Filipin (zeljko-filipin) said :
#3

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? Is this fixed in Sikuli X-1.0rc3 (r905)?

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

Revision history for this message
RaiMan (raimund-hocke) said :
#4

@ Zeljko

--- incorrect usage
dragDrop(t, [t.x + 100, t.y + 100])

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)

-- correct:
dragDrop(t, Location(t.x + 100, t.y + 100))

Revision history for this message
Željko Filipin (zeljko-filipin) said :
#5

Thanks a lot, adding Location fixed the problem.

Revision history for this message
vidya rajagopal (vidya-rajagopal) said :
#6

Hi ,

When i use " dragDrop(t, Location[t.x,t.y+10])" i am getting error as TypeError: 'java.lang.Class' object is unsubscriptable.
Could you please let me know what i am missing ?

Thanks