当我试着运行下面的代码时,visibilityOfElementLocated
工作得很好,webdriver等待给定时间的元素。visibilityOfElementLocated vss visibilityOf
dr.get("http://www.seleniumframework.com/Practiceform/");
WebDriverWait wait=new WebDriverWait(dr,30);
WebElement we = wait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText("Element5")));
,但如果我使用visibilityOf
以同样的方式,它给了我
NoSuchElementException异常
WebElement we = wait.until(ExpectedConditions.visibilityOf(dr.findElement(By.linkText("Element3"))));
你能解释我为什么我得到这个例外?