how to give a wait time based on image

Asked by krishna

Hi,

The scenario is, i have file installed in the system. I can delete or reinstall the file.
When i delete or install the file, I can see the percentage of progress in one of the screen window.

The thing is i need to wait until that percentage window reaches to 100%, then only i need to proceed with the further steps.

Logic i have planned is -
capturing image of progress window with 100%.
ie :
img = "progressWindowWith100%.png"
img1 = "progressWindowWithZero%.png"

while ( img1 <= img ):
           wait()
           img = img +1
click (ok.png)

Is this a correct logic? Or can you suggest the code for to wait untill the image becomes 100%.

Regards,
Krishna

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Karl
Solved:
Last query:
Last reply:
Revision history for this message
Best Karl (k-d) said :
#1

Use an observe and in the onAppear handler click OK, then stop the observer.

http://doc.sikuli.org/region.html#Region.stopObserver (has an example)

Revision history for this message
krishna (krishna-raj387) said :
#2

Thanks Karl, that solved my question.