How to change findAll WaitTimeout individually

Asked by eduardobedoya

Hi,

I would like to change the default WaitTimeout of a single findAll

I know Settings.AutoWaitTimeout = (seconds) can change the default WaitTimeout in all the script (I don't know why everytime I have tested it, it only applies from the second time I run my script on, the first time I run the script the WaitTimeout remain to the defult value 3secs despite Settings.AutoWaitTimeout is set to 0)
I know also setAutoWaitTimeout = (seconds) set the maximum waiting time for all subsequent find operations.

So if I want to change the default WaitTimeout only for a single findAll op, I should use two "setAutoWaitTimeout", one before to set to custom, and another after the findAll op to restore to default, Iam right? is this the only way?

isn't anything like...
if exist (Img, 0.2): #where 0.2 is the wait time and can be changed
but applied to findAll?

please any hint is very welcome

Thanks Advanced.

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 :
#2

At time of creation of a new region, this region takes the standard wait time currently stored with Settings.AutoWaitTimeout.

For an existing region, you can use Region.setAutoWaitTimeout() to adjust the value for this region.

In scripting, when using the whole screen with just
findAll(img)

instead of a specified region like
someRegion.findAll()

just use
setAutoWaitTimeout() to adjust the screens value, but be aware: this is used for ALL subsequent find ops until changed again.

BTW: this is all in the docs.

Revision history for this message
eduardobedoya (gonnabdh) said :
#3

Thanks RaiMan, that solved my question.