Troubleshooting a script can be long and exhausting especially if there are objects which can not be found. Fortunately, we can adjust the timeout duration for
waitForObject to save us some time.
By default the duration of
waitForObject is 20000 milliseconds (20 seconds), which looks like this:
During the given time Squish will check if the object can be located, is visible and enabled. If this is the case, the script continues otherwise returns an error and stops.
How to adjust the waitForObject timeout?
To change a single
waitForObject occurrence you need to specify an alternate duration in milliseconds:
In the example above,
waitForObject has a maximum duration of 1000 milliseconds (1 second) until the script will continue or abort.
How to set the default value, on a Test-Suite basis?
As of Squish 6.4, it is now possible to set it on a test suite basis, from SquishIDE, in the Test Suite Settings - Test Settings tab. From there, you can set the
waitForObjectTimeout to something different, in milliseconds.
What about Squish 6.3?
You can place an xml file called
config.xml into the test suite directory (next to
suite.conf) and set the value on a test suite basis. In the example below, it is set to 2 seconds (2000 milliseconds) .
<information> <summary/> <description/> </information>
Find out more about
waitForObject in our Documentation.