似乎'waitForEnabled'与Webdriver的elementToBeClickable不同。有人可以帮助它的API吗?
答案 0 :(得分:0)
public static WebElement ElementToBeClickable(WebElement element)
{
try
{
if (element != null && element.isDisplayed() && element.isEnabled())
{
return element;
}
else
{
return null;
}
}
catch (StaleElementReferenceException e)
{
return null;
}
}
尝试以上方法:
答案 1 :(得分:-1)
WebDriverWait wait = new WebDriverWait(driver,timeout);
element = wait.until(ExpectedConditions.visibilityOfElementLocated(locator));