[1.1.0] Mouse.move(x, y): seems to block subsequent usage of Region.click()

Asked by Spencer Keller

I'm using Sikuli V1.1 with Java 1.7. (I'm calling the Sikuli Java SDK)

I just added a little code to move the mouse and "click" ( Mouse.down()) followed by Mouse.up() ) to select an item from a combo box. It seems to work fine however the next operation presses the submit button with a {region}.click() operation and that hangs. It never returns.

Thanks,
Spence

Question information

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

Supposing you are talking about SikuliX 1.1.0
... or is it the SikuliJava API from here
https://code.google.com/archive/p/sikuli-api/

What system are you working on?

--- I'm calling the Sikuli Java SDK
what exactly are you talking about?

paste the code snippet, to show, what exactly you are doing.

Revision history for this message
Spencer Keller (spencer-keller) said :
#2

Hi,

I'm using the sdk jar that came with the Sikuli 1.1.0 "SikuliX" download from: https://launchpad.net/sikuli/sikulix/1.1.0. And I'm developing on Windows 7. Should I be using a different jar? Perhaps the one from the code.google.com link you provided?

So what I'm doing is writing Java 1.7 test code that makes calls to the SikuliX SDK jar to interact with the application under test. There is no Python or any other language being used. Here is a little Java code snippet:

// This opens the list of items in a combo box.
        Pattern header = new Pattern(_EDIT_ACCOUNT_DIALOG);
        header.similar(0.80f);
        Region tmp = exists(header).grow(0, 0, 0, 350);
        tmp.find(_ACTIVE_COMBO_BOX).click();

// This selects one of the items in the combo box.
      Mouse.move(0, 50);
      Mouse.down(Button.LEFT);
      Mouse.up();

// This code then clicks the dialogs "Submit" button.
        Pattern header = new Pattern(_EDIT_ACCOUNT_DIALOG);
        header.similar(0.80f);
        Region tmp = exists(header).grow(0, 0, 0, 350);
        tmp.click(_SUBMIT_BUTTON); <<<---- This is where the problem occurs. The click NEVER returns.

If I remove the Mouse calls and use a Match object with an click offset (setTargetOffset) if works fine. The Match work-a-round is working just fine so there is no urgency on my part. I hope this is a bit clearer.

Thanks,
Spence

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

// This selects one of the items in the combo box.
      Mouse.move(0, 50);
      Mouse.down(Button.LEFT);
      Mouse.up();

... seems you have touched an area, that was not tested thoroughly enough ;-)

Try this instead
// This selects one of the items in the combo box.
     tmp.click(Mouse.at().offset(0, 50))

... which is equivalent to the above sequence

Revision history for this message
Spencer Keller (spencer-keller) said :
#4

I like your work-a-round better than mine and it works just fine. Thanks.