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