首页 > 解决方案 > selenium WebDriverWait.Untils NoSuchMethodError

问题描述

在我的 selenium webdriver 中,我正在尝试使用 WebDriverWait.Untils 但它失败了,我收到如下错误:

java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object;

我的代码:

WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//button[@id='btn-generalInfo']//span[1]"))).click();

我的 pom.xml 是

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>3.141.59</version>
</dependency>
    

标签: seleniumselenium-webdriver

解决方案


推荐阅读