Async::WebDriver SourceAsyncWebDriverScopeTimeouts

module Timeouts

Helpers for working with timeouts.

If your tests are failing because the page is not loading fast enough, you can increase the page load timeout:

session.script_timeout = 1000 # 1 second
session.implicit_wait_timeout = 10_000 # 10 seconds
session.page_load_timeout = 60_000 # 60 seconds

Definitions

def timeouts

Get the current timeouts.

Signature

returns Hash

The timeouts.

Implementation

def timeouts
	session.get("timeouts")
end

def script_timeout

The script timeout is the amount of time the driver should wait when executing JavaScript asynchronously.

Signature

returns Integer

The timeout in milliseconds.

Implementation

def script_timeout
	timeouts["script"]
end

def script_timeout=(value)

Set the script timeout.

Signature

parameter value Integer

The timeout in milliseconds.

Implementation

def script_timeout=(value)
	session.post("timeouts", {script: value})
end

def implicit_wait_timeout

The implicit wait timeout is the amount of time the driver should wait when searching for elements.

Signature

returns Integer

The timeout in milliseconds.

Implementation

def implicit_wait_timeout
	timeouts["implicit"]
end

def implicit_wait_timeout=(value)

Set the implicit wait timeout.

Signature

parameter value Integer

The timeout in milliseconds.

Implementation

def implicit_wait_timeout=(value)
	session.post("timeouts", {implicit: value})
end

def page_load_timeout

The page load timeout is the amount of time the driver should wait when loading a page.

Signature

returns Integer

The timeout in milliseconds.

Implementation

def page_load_timeout
	timeouts["pageLoad"]
end

def page_load_timeout=(value)

Set the page load timeout.

Signature

parameter value Integer

The timeout in milliseconds.

Implementation

def page_load_timeout=(value)
	session.post("timeouts", {pageLoad: value})
end