Table of Contents

Interface ITimeouts

Namespace
OpenQA.Selenium
Assembly
WebDriver.dll

Defines the interface through which the user can define timeouts.

public interface ITimeouts

Methods

ImplicitlyWait(TimeSpan)

Specifies the amount of time the driver should wait when searching for an element if it is not immediately present.

ITimeouts ImplicitlyWait(TimeSpan timeToWait)

Parameters

timeToWait TimeSpan

A TimeSpan structure defining the amount of time to wait.

Returns

ITimeouts

A self reference

Remarks

When searching for a single element, the driver should poll the page until the element has been found, or this timeout expires before throwing a NoSuchElementException. When searching for multiple elements, the driver should poll the page until at least one element has been found or this timeout has expired.

Increasing the implicit wait timeout should be used judiciously as it will have an adverse effect on test run time, especially when used with slower location strategies like XPath.

SetPageLoadTimeout(TimeSpan)

Specifies the amount of time the driver should wait for a page to load when setting the Url property.

ITimeouts SetPageLoadTimeout(TimeSpan timeToWait)

Parameters

timeToWait TimeSpan

A TimeSpan structure defining the amount of time to wait. Setting this parameter to MinValue will allow the page to load indefinitely.

Returns

ITimeouts

A self reference

SetScriptTimeout(TimeSpan)

Specifies the amount of time the driver should wait when executing JavaScript asynchronously.

ITimeouts SetScriptTimeout(TimeSpan timeToWait)

Parameters

timeToWait TimeSpan

A TimeSpan structure defining the amount of time to wait. Setting this parameter to MinValue will allow the script to run indefinitely.

Returns

ITimeouts

A self reference