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

来源:互联网 发布:simpleadapter源码 编辑:程序博客网 时间:2024/06/07 15:40

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

0 0
原创粉丝点击