WebDriverWait wait = new WebDriverWait(driver, timoutInSeconds);
List<WebElement> elements =
wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(by));
它的Maven項目,我已經升級到硒從2.53.0版本3.4.0,並添加番石榴的依賴與21.0版。 早些時候所有的等待都在起作用。當升級到最新的硒3.4.0版本時,所有等待中斷。執行測試時會收到以下錯誤。WebDriverWait wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(所))不宜與硒工作3.4.0
java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until(Ljava/util/function/Function;)Ljava/lang/Object;
很多網友說加入番石榴依賴這個問題已經不存在,但我甚至增加番石榴依賴後看到了這個問題。
這裏是加入Maven依賴 <依賴性> com.google.guava 番石榴 21.0 依賴> dependencyManagement> <依賴性> org.seleniumhq.selenium 硒-java的 3.4.0 編譯 依賴> –
user3766763
1 )你是否先運行'mvn clean'? 2)發表你的整個'pom.xml' - 和** not **在評論中,但編輯你的原始文章。 – SiKing