Package org.openqa.selenium.support.ui
Class WebDriverWait
A specialization of
FluentWait
that uses WebDriver instances.-
Field Summary
Fields inherited from class org.openqa.selenium.support.ui.FluentWait
DEFAULT_SLEEP_TIMEOUT
-
Constructor Summary
ConstructorDescriptionWebDriverWait
(WebDriver driver, Duration timeout) Wait will ignore instances of NotFoundException that are encountered (thrown) by default in the 'until' condition, and immediately propagate all others.WebDriverWait
(WebDriver driver, Duration timeout, Duration sleep) Wait will ignore instances of NotFoundException that are encountered (thrown) by default in the 'until' condition, and immediately propagate all others. -
Method Summary
Modifier and TypeMethodDescriptionprotected RuntimeException
timeoutException
(String message, Throwable lastException) Throws a timeout exception.Methods inherited from class org.openqa.selenium.support.ui.FluentWait
ignoreAll, ignoring, ignoring, pollingEvery, until, withMessage, withMessage, withTimeout
-
Constructor Details
-
WebDriverWait
Wait will ignore instances of NotFoundException that are encountered (thrown) by default in the 'until' condition, and immediately propagate all others. You can add more to the ignore list by calling ignoring(exceptions to add).- Parameters:
driver
- The WebDriver instance to pass to the expected conditionstimeout
- The timeout when an expectation is called- See Also:
-
WebDriverWait
Wait will ignore instances of NotFoundException that are encountered (thrown) by default in the 'until' condition, and immediately propagate all others. You can add more to the ignore list by calling ignoring(exceptions to add).- Parameters:
driver
- The WebDriver instance to pass to the expected conditionstimeout
- The timeout in seconds when an expectation is calledsleep
- The duration in milliseconds to sleep between polls.- See Also:
-
WebDriverWait
public WebDriverWait(WebDriver driver, Duration timeout, Duration sleep, Clock clock, Sleeper sleeper) - Parameters:
driver
- the WebDriver instance to pass to the expected conditionsclock
- used when measuring the timeoutsleeper
- used to make the current thread go to sleeptimeout
- the timeout when an expectation is calledsleep
- the timeout used whilst sleeping
-
-
Method Details
-
timeoutException
Description copied from class:FluentWait
Throws a timeout exception. This method may be overridden to throw an exception that is idiomatic for a particular test infrastructure, such as an AssertionError in JUnit4.- Overrides:
timeoutException
in classFluentWait<WebDriver>
- Parameters:
message
- The timeout message.lastException
- The last exception to be thrown and subsequently suppressed while waiting on a function.- Returns:
- Nothing will ever be returned; this return type is only specified as a convenience.
-