我从 WebDriverWait 更改为 FluentWait 因为它已被弃用,现在出现错误
private val waitForElement = FluentWait(DriverFactory.driver).withTimeout(Duration.ofMinutes(1)).pollingEvery(Duration.ofSeconds(1))
@Step("Choose button")
fun Wizard() {
waitForElement.until(ExpectedConditions.elementToBeClickable(firstPage.wizardLocator))
firstPage.wizardLocator?.click()
?: throw IllegalStateException("could not locate the wizard button")
}
收到此错误:
Message: org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element