我从事开发和 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);
}
特别是我想了解的两件事;
- return fluentWait() 到底在做什么?
- 在这里使用 until() 是什么意思?