Skip to main content

Timeouts

Timeouts define maximum allowable finish time for a process. When a process doesn't end within the allowed time, it gets killed leading to a timeout error and test failure.

Functions that find elements, wait for something to happen, execute scripts and open urls use certain type of timeouts that you can configure. Following timeouts are supported in ZWL:

Element access timeout#

The maximum time limit to find an element on page. The default element access timeout is 10 seconds.

Page load timeout#

The maximum time limit to load a web page. The default element access timeout is 30 seconds.

Script timeout#

The maximum time limit a script is allowed to run. The default element access timeout is 10 seconds.

Options to customize timeouts#

You can customize timeout in following ways:

  • Change any type of timeout once for an entire build by configuring it in Build Capability.

  • Use functions setElementAccessTimeout(milliseconds), setPageLoadTimeout(milliseconds) or setScriptTimeout(milliseconds) in beginning and end of a test to set and reset it in middle of a build. This will apply the timeout setting for only that specific test. See below example:

    defaultElemAccessTimeout = getTimeout(timeouts.elemAccess)setElementAccessTimeout(2 * 1000)/*TEST_CODE_HERE*/setElementAccessTimeout(defaultElemAccessTimeout)

    timeouts constant auto suggest available values when you do timeouts. in IDE.

    Note that if you don't reset the timeout, the timeout remains same for the lifetime of a build and applies to all tests which you may not want (see why in Best Practices).