← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #250815]: Drag and drop not working with java

 

Question #250815 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/250815

    Status: Open => Answered

RaiMan proposed the following answer:
--- are you aware of?
using
 s.exists(firefox);

does nothing else, but searching for image firefox and storing the match
(if found) into lastMatch of s (available through s.getLastMatch()). if
not found. simply nothing happens.

So what is your intention with this usage?

--- your problem
on Windows usually mouse actions go to the topmost window. so if you are sure, the window where the drag-drop should happen, a separate focus() is not necessary.

Looking at your code: the dragDrop should work.

What exactly can you see, when the flow comes to that point? Does the mouse hover at thumbnail and move to placeholder?
you might use:
Settings.showActions = true;

before the dragDrop, which switches on slow motion, showing the mouse
position.

You might try:
Match mFrom = find(thumbnail)
Match mTo = find(placeholder)
s.dragDrop(mFrom, mTo);

and the mouse action variant:
   s.hover(thumbnail); //you might try a s.click(thumbnail) instead, if this does not trigger any actions
   s.mouseDown(Button.LEFT);
   //s.wait((double) 1.0); // not needed because the following search adds some time
   s.mouseMove(placeholder);
   s.wait((double) 0.5);
   s.mouseUp();

Since you only complain the dargDrop action, I suppose, that the flash
app can be acted on by Sikuli (click works).

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.