Provides the ability to wait for an arbitrary condition during test execution.
Inheritance Hierarchy
OpenQA.Selenium.Support.UIDefaultWaitIWebDriver
OpenQA.Selenium.Support.UIWebDriverWait
Namespace: OpenQA.Selenium.Support.UI
Assembly: WebDriver.Support (in WebDriver.Support.dll) Version: 3.1.0
Syntax
The WebDriverWait type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | WebDriverWait(IWebDriver, TimeSpan) |
Initializes a new instance of the WebDriverWait class.
|
![]() | WebDriverWait(IClock, IWebDriver, TimeSpan, TimeSpan) |
Initializes a new instance of the WebDriverWait class.
|
Properties
Name | Description | |
---|---|---|
![]() | Message |
Gets or sets the message to be displayed when time expires.
(Inherited from DefaultWaitT.) |
![]() | PollingInterval |
Gets or sets how often the condition should be evaluated. The default timeout is 500 milliseconds.
(Inherited from DefaultWaitT.) |
![]() | Timeout |
Gets or sets how long to wait for the evaluated condition to be true. The default timeout is 500 milliseconds.
(Inherited from DefaultWaitT.) |
Methods
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IgnoreExceptionTypes |
Configures this instance to ignore specific types of exceptions while waiting for a condition.
Any exceptions not whitelisted will be allowed to propagate, terminating the wait.
(Inherited from DefaultWaitT.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ThrowTimeoutException |
Throws a WebDriverTimeoutException with the given message.
(Inherited from DefaultWaitT.) |
![]() | ToString | (Inherited from Object.) |
![]() | UntilTResult |
Repeatedly applies this instance's input value to the given function until one of the following
occurs:
(Inherited from DefaultWaitT.)
|
Examples
IWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(3)) IWebElement element = wait.Until(driver => driver.FindElement(By.Name("q")));
See Also