我進入開發和新QA /自動化測試。 我想了解下面的代碼;瞭解流利硒等待
public WebElement getVisibleElement(final By by, final WebElement parentElement, int timeoutValue, TimeUnit timeoutPeriod, int pollingInterval, TimeUnit pollingPeriod) {
return fluentWait(timeoutValue, timeoutPeriod, pollingInterval, pollingPeriod).until(new Function<WebDriver, WebElement>() {
public WebElement apply(WebDriver driver) {
try {
} catch {
}
return null;
}
});
}
在我的同班同學中,我也有;
public Wait<WebDriver> fluentWait(int timeoutValue, TimeUnit timeoutPeriod, int pollingInterval, TimeUnit pollingPeriod) {
return new FluentWait<WebDriver>(this.webDriver)
.withTimeout(timeoutValue, timeoutPeriod)
.pollingEvery(pollingInterval, pollingPeriod)
.ignoring(NoSuchElementException.class);
}
特別是我想了解的2件事;
- 什麼是返回fluentWait()正在做什麼?
- until()是什麼意思?