java - 无法实现显式等待

标签 java selenium selenium-webdriver

我尝试在脚本中添加显式等待,但收到以下错误

"The type com.google.common.base.Function cannot be resolved. It is indirectly referenced from required .class files"

我的代码

WebElement okButton;
okButton = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//button[@id='buttonResolveResultOk']")));

最佳答案

我将 Guava 更新到最新版本,这帮助我解决了这个问题

<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>21.0</version>
</dependency>

关于java - 无法实现显式等待,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48561341/

相关文章:

java - 模型属性存储在哪里?

java - 自动向数据库插入记录

ajax - Tapestry5.1+seleniumRc Ajax waitForAjax Request

javascript - setAttribute ('display' ,'block' )不工作 selenium-webdriver Node js

javascript - 使用selenium使用xpath输入多个元素

java - 有没有办法启动隐藏的jar文件?

java - JProgressBar 更新

javascript - executescript 不适用于 InternetExplorer 驱动程序 (Selenium)

java - Tomcat - 监听两个端口以进行测试

java - 无法验证选定的复选框,Selenium Webdriver Java