← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #229736]: How to wait and refresh untill a image is found ?

 

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

Bunnings proposed the following answer:
The above answer will not cater for your refresh until image appears
need. Try the following


def RefreshUntilImageAppears(self)

      img = region.exists(imagepath, 1)
      noofretry = 0

      while(img == None and noofretry < 5):
           RefreshPage(); 
           wait(1)
           img = region.exists(imagepath, 1)
           noofretry += 1

Obviously in the above logic(syntax may vary depending on your programming language) you can adjust the number of retries. 
Also you can raise an error if the image is not found even after that.

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