您的位置:首页 > 其它

Selenium Webdriver : Element not found in the cache - perhaps the page has changed since it

2015-11-06 10:45 609 查看
Selenium
Webdriver with Java: Element not found in the cache - perhaps the page has changed since it was looked up

可以写这样的方法,先找到这个元素,再点击

public void clickAnElementByLinkText(String linkText) {
wait.until(ExpectedConditions.presenceOfElementLocated(By.linkText(linkText)));
driver.findElement(By.linkText(linkText)).click();
}

然后调用

clickAnElementByLinkText("文字");


可参考

http://stackoverflow.com/questions/17972359/selenium-webdriver-with-java-element-not-found-in-the-cache-perhaps-the-page
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: