← Back to team overview

sikuli-driver team mailing list archive

[Question #667270]: While loop that stops when the condition is no longer met

 

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

I would like first of all to thank you all for the contribution you make to this site, I learn all from you all.

I set up an automation script that scrolls down to the bottom of the web page, clicks on a button and repeat the process but I'd like it to break when the button ("SHOWMORECOMM-1.png") is no longer visible. Here is what I have so far:

switchApp("Firefox.app")

while not exists("SHOWMORECOMM-1.png") and not exists("1522075524740.png"):
    wait(5)
    type(Key.END)
    
    wait("SHOWMORECOMM-1.png", 2)      
    click("SHOWMORECOMM-1.png")
    wait(5)
        
    if exists("SHOWMORECOMM-1.png") and exists("1522075524740.png"):
        click("SHOWMORECOMM-1.png")    
    else:        
        break





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