← Back to team overview

sikuli-driver team mailing list archive

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

 

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

Description changed to:
I would like first of all to thank you all for the contribution you make
to this site, I learn 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.