← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #209883]: dargDrop not working reliably (related to https://answers.launchpad.net/sikuli/+question/133497 AND 148465)

 

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

Description changed to:
dragDrop is not working consistently for me.   I am using Sikuli r930 on
a  64bit Windows7 PC.

I'm trying to capture the label of a checkbox in Sikuli.  The function
creates a list of all checkboxes on a screen (omitting specifc ones)
then individually checks a single checkbox  at a time and captures it's
label (by selecting the label's text and copying it using type("c",
KEY_CTRL)).   The copying works perfectly as long as dragDrop selects
the correct text.  The problem is that the text selecting/highlighting
only works the first few times (using the copy functions shown below).
It checks the box (so I know it's the correct coordinates) but then
highlights and copies the label of a different checkbox far to the
right.

I notice as the program continues and starts misbehaving, when it
selects (checks) a checkbox the mouse does not move to the point over
the checkbox (as it did in the beginning when it properly highlighted
the text).  The mouse pointer was farther over to the right (as in 3.5
inches over, even though my debug print showed it was the right
coordinates).  It's as if the start point for the mouse was incorrect.
hover(item.getCenter()) did not work either.....  nor did using
mouseMove(begin).

I tried applying a possible solution related to speed/mouse issues
described in questions 133497 AND 148465 to no avail.

[133497 caused the mouse to initially drag upward and subsequently
downward on the next execution]

The basic code that worked part of the time:

def copy(begin, end):
    dragDrop(begin, end)
    type("c", KEY_CTRL)

Then.....:

def copy(begin, end):
    mouseMove(begin); wait(0.7)
    mouseDown(Button.LEFT); wait(0.7)
    mouseMove(end); wait(0.8)
    mouseUp()
    type("c", KEY_CTRL)

(as well as those recommendations from 133497 AND 148465).

These are called using match or location objects.

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