problems with wait("text", FOREVER)

Asked by Initg

I use myApp.window(0).wait("other", FOREVER) to wait the "other" string appears on the region of window(0). If "other" string appear quickly(wait about 5 seconds), wait() function can find it successfully. But if "other" string appears after about 20 minutes, the wait() function can not find it at all. Does anybody encounter this problem? If it is a bug of wait() function? How can I workaround this problem?

Thanks.

Question information

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

This might be a problem with the text finding feature together with the internal "waiting loop".

But it does not make any sense, to complain about that, since they will revise the text/OCR feature anyway.

You can do 2 things:
--- restrict the search even more inside the app window
w = myApp.window(0)
r = w. ... # a new smaller region
# that is expected to contain the searched text

--- make your own waiting loop
while True:
    if r.exists("other", 0): break
    wait(1)

this would look one time every second.

Revision history for this message
Initg (initg) said :
#2

Thanks RaiMan, that solved my question.