我用Java编写了一个selenium脚本。突然,方法wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("someId")))
无法正常工作。它以前工作过,但我无法记住一个改变,这就是这个错误。
我没有忘记初始化wait var。我这样做了:" WebDriverWait wait = new WebDriverWait(driver, 100000);
"。
我的IDE说"无法解决方法'直到......'"当我移过带红色下划线的文字时。
当我尝试运行main时,会出现以下错误:
Error:(54, 13) java: cannot access com.google.common.base.Function
class file for com.google.common.base.Function not found
Error:(82, 17) java: no suitable method found for until(org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement>)
method org.openqa.selenium.support.ui.FluentWait.until(com.google.common.base.Predicate<org.openqa.selenium.WebDriver>) is not applicable
(argument mismatch; org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement> cannot be converted to com.google.common.base.Predicate<org.openqa.selenium.WebDriver>)
method org.openqa.selenium.support.ui.FluentWait.<V>until(com.google.common.base.Function<? super org.openqa.selenium.WebDriver,V>) is not applicable
(cannot infer type-variable(s) V
(argument mismatch; org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement> cannot be converted to com.google.common.base.Function<? super org.openqa.selenium.WebDriver,V>))
有人可以帮忙吗?