← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #224893]: Sequential Vs POP UP

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Your idea is principally ok:

Settings.MoveMouseDelay=0
while True:
    if exists(popupimage, 0):
        click(okbutton)
    wait(1)

If you run this script from command line using Sikuli-IDE-w.bat, it will do what you want.
Be aware: this script must be killed with the TaskManager to stop it.

But this might not prevent your first script from crashing in all cases, because the 2 scripts will not coordinate the usage of mouse and keyboard.
This is the situation (might have a low probability): your main script found an image and before it can click, the popup comes up. If the popup now hides the click point, the click will happen, but with no effect in the sense of your script. So now though the poup will be handled, the next action of your script will fail.

Another case is, that the clickpoint is still visible outside the popup, and the popup handler uses the mouse in the same time, that the main script is in a click process. To reduce this risk, use the Settings.MoveMouseDelay=0 in your main script too - this will switch off the mouse move animation, which simply is some delay between finding and clicking.
If you could handle the popup without using the mouse (e.g. with a type(Key.ENTER)), this will solve the mouse problem generally.

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