public class WebDriverWait extends Object implements Wait<org.openqa.selenium.WebDriver>
ExpectedCondition
interface.
Because waiting for elements to appear on a page is such a common use-case, this class will silently swallow NotFoundException whilst waiting.
Constructor and Description |
---|
WebDriverWait(org.openqa.selenium.WebDriver driver,
long timeOutInSeconds) |
Modifier and Type | Method and Description |
---|---|
<T> T |
until(com.google.common.base.Function<org.openqa.selenium.WebDriver,T> isTrue)
Implementations should wait until the condition evaluates to a value that
is neither null nor false.
|
public WebDriverWait(org.openqa.selenium.WebDriver driver, long timeOutInSeconds)
driver
- The WebDriver instance to pass to the expected conditionstimeOutInSeconds
- The timeout in seconds when an expectation is
calledpublic <T> T until(com.google.common.base.Function<org.openqa.selenium.WebDriver,T> isTrue)
Wait
If the condition does not become true within a certain time (as defined
by the implementing class), this method will throw a non-specified
Throwable
. This is so that an implementor may throw whatever is
idiomatic for a given test infrastructure (e.g. JUnit4 would throw AssertionError
.
until
in interface Wait<org.openqa.selenium.WebDriver>
T
- the return type of the method, which must not be VoidisTrue
- the parameter to pass to the ExpectedCondition
Copyright © 2011 Nuxeo SA. All Rights Reserved.