← Back to team overview

sikuli-driver team mailing list archive

[Question #678997]: Not find exception thrown unexpectedly

 

New question #678997 on Sikuli:
https://answers.launchpad.net/sikuli/+question/678997

Hello,
I'm using 1.1.4-SNAPSHOT-#221-2019-03-05_11:49/Windows10.0/Java8(64)1.8.0_191-b12
I have to click on a button, that will cause the visible page to change making appearing FirstElementOfNewPage.png, from then the script goes on.
Sometimes (~2% of cases) the target application doesn't reacts to the first click (Settings.MoveMouseDelay=0.1) and so the FirstElementOfNewPage.png doesn't appears, my idea would be in these cases to reclick on the same button and retry the search for FirstElementOfNewPage.png.

I have a script like this one:
    try:
        click("ChangePageButton.png")#first try
        mouseMove(100, 100) #this is present to move the mouse cursor from the button and allow a better finding of the button for second try
        wait ("FirstElementOfNewPage.png",30)
    except:
        click("ChangePageButton.png")#retry
        wait ("FirstElementOfNewPage.png",30)
        
What happens is that the script goes in the except part 80-90% of the times, also when the situation is completely ok (i.e. FirstElementOfNewPage.png is well visible). Prior that introducing the try-except the script was working rather well with a notFound problem every ~50 attempts.
I was wondering if the wait (or MouseMove) operation could trigger somehowthe exception.
Thanks for help!

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.