[1.1.0] How to control the inner timing of dragDrop()

Asked by Nikki

I would like to resize a column using dragDrop method but nothing happens when using this code:

col=find(Pattern("1443032753714.png").targetOffset(0,-1))
dragDrop(col,[col.x+200,col.y])

Can you tell me what I am doing wrong? I really don't know how to use dragDrop method just from the other questions to do with dragDrop, I know that it has two parameters.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

If mouse actions generally work with your target app/GUI, the this is usually a timing problem (the sequence of mouse actions done by SikuliX are too fast).

a drag drop in terms of basic mouse actions is like this:

# dragDrop(from, to)
hover(from)
wait(beforeMouseDown)
mouseDown(Button.LEFT)
wait(beforeDrag)
hover(to)
wait(beforeDrop)
mouseUp()

the wait times beforeMouseDown, beforeDrag, beforeDrop can be adjusted, to fulfill the GUI's requirements.
Usually small values between 0.2 and 0.5 are sufficient.

I just revised the dragDrop() in version 1.1.0.
Beginning with tomorrow's build the following is available:
- the timing parameters beforeMouseDown, beforeDrag, beforeDrop in the standard are 0.3 seconds each
- using Settings.beforeMouseDown, Settings.beforeDrag, Settings.beforeDrop they can individually be set for the next following dradDrop() (after completion of the dragDrop they will be reset to the default value)

example:
Settings.beforeMouseDown = 0.4
Settings.beforeDrag = 0.5
Settings.beforeDrop = 0.1
dragDrop(from, to)

the values are used accordingly with drag() and dropAt() also.

The docs will be revised tomorrow also.

Revision history for this message
masuo (masuo-ohara) said :
#2

I am using SikuliX1.1.0 (2015-09-05 nightly) on Windows7
This is a report on my environment.

Following script works good.

f = find("image.png")
dragDrop(f, Location(f.x + 200, f.y))

Revision history for this message
Nikki (nikikimnm) said :
#3

This doesn'tdo anything:

 f = find("image.png")
dragDrop(f, Location(f.x + 200, f.y))

Revision history for this message
masuo (masuo-ohara) said :
#5

When I specified the trash on the desktop to image, it works properly.
What happened ? Let's check the message .

If the image did not found:
[error] FindFailed ( can not find ・・・・

Did you get error messages?

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

@Nikki
in comment #1 i said this:

I just revised the dragDrop() in version 1.1.0.
Beginning with tomorrow's build the following is available:
- the timing parameters beforeMouseDown, beforeDrag, beforeDrop in the standard are 0.3 seconds each
- using Settings.beforeMouseDown, Settings.beforeDrag, Settings.beforeDrop they can individually be set for the next following dradDrop() (after completion of the dragDrop they will be reset to the default value)

example:
Settings.beforeMouseDown = 0.4
Settings.beforeDrag = 0.5
Settings.beforeDrop = 0.1
dragDrop(from, to)

the values are used accordingly with drag() and dropAt() also.

The docs will be revised tomorrow also.

this was on 2015-09-24
so the mentioned "tomorrow" would be 2015-09-25

you are still running 2015-09-05.
So please upgrade to the latest nightly build and experiment with the revised dragDrop()

Can you help with this problem?

Provide an answer of your own, or ask Nikki for more information if necessary.

To post a message you must log in.