这条警告消息...
The following methods are deprecated:
public WebDriverWait(WebDriver driver, long timeoutInSeconds)
@Deprecated
public WebDriverWait(WebDriver driver, long timeoutInSeconds) {
this(driver, Duration.ofSeconds(timeoutInSeconds));
}
public WebDriverWait(WebDriver driver, long timeoutInSeconds, long sleepInMillis)
@Deprecated
public WebDriverWait(WebDriver driver, long timeoutInSeconds, long sleepInMillis) {
this(driver, Duration.ofSeconds(timeoutInSeconds), Duration.ofMillis(sleepInMillis));
}
public WebDriverWait(WebDriver driver, Clock clock, Sleeper sleeper, long timeoutInSeconds, long sleepInMillis)
@Deprecated
public WebDriverWait(
WebDriver driver, Clock clock, Sleeper sleeper, long timeoutInSeconds, long sleepInMillis) {
this(
driver,
Duration.ofSeconds(timeoutInSeconds),
Duration.ofMillis(sleepInMillis),
clock,
sleeper);
}
Whilst the following methods were added:
public WebDriverWait(WebDriver driver, Duration timeout)
public WebDriverWait(WebDriver driver, Duration timeout) {
this(
driver,
timeout,
Duration.ofMillis(DEFAULT_SLEEP_TIMEOUT),
Clock.systemDefaultZone(),
Sleeper.SYSTEM_SLEEPER);
}
public WebDriverWait(WebDriver driver, Duration timeout, Duration sleep)
public WebDriverWait(WebDriver driver, Duration timeout, Duration sleep) {
this(driver, timeout, sleep, Clock.systemDefaultZone(), Sleeper.SYSTEM_SLEEPER);
}
WebDriver driver, Duration timeout, Duration sleep, Clock clock, Sleeper sleeper)
public WebDriverWait(WebDriver driver, Duration timeout, Duration sleep, Clock clock, Sleeper sleeper) {
super(driver, clock, sleeper);
withTimeout(timeout);
pollingEvery(sleep);
ignoring(NotFoundException.class);
this.driver = driver;
}