Configure or retrieve the amount of time that a particular type of operation can execute for before they are aborted and a |Timeout| error is returned to the client.

If called with only a callback as argument, the command will return the existing configured timeout values.

Usage

.timeouts([callback])
.timeouts(type, ms, [callback])

Parameters

Name Type description
type string

The type of operation to set the timeout for. Valid values are "script" for script timeouts, "implicit" for modifying the implicit wait timeout and "pageLoad" (or "page load" for legacy JsonWire) for setting a page load timeout.

ms number

The amount of time, in milliseconds, that time-limited commands are permitted to run.

callback
Optional
function

Optional callback function to be called when the command finishes.

Example

 this.demoTest = function (browser) {
   browser.timeouts('script', 10000, function(result) {
     console.log(result);
   });

   browser.timeouts(function(result) {
     console.log('timeouts', result);
   });
}

W3C WebDriver spec