selenium找不到合适的方法(ExpectedCondition )

这是有线问题! 我导入的项目是100%(几个月前)工作的,今天我用依赖项导入了它, WebDriverWait存在一个问题

这是我的代码:

 WebDriverWait driverWait = new WebDriverWait(driver, 10000); driverWait.until(ExpectedConditions.presenceOfElementLocated(By.id("saveBut1")));//here's the issue 

这是错误:

 no suitable method found for until(ExpectedCondition) method FluentWait.until(Predicate) is not applicable (argument mismatch; ExpectedCondition cannot be converted to Predicate) method FluentWait.until(Function) is not applicable (cannot infer type-variable(s) V (argument mismatch; ExpectedCondition cannot be converted to Function)) where V,T are type-variables: V extends Object declared in method until(Function) T extends Object declared in class FluentWait 

我使用Netbeans作为IDE,然后使用它导出项目(3个月前)

我也遇到了这个问题,问题是(正如上面的评论中所建议的那样)我缺少谷歌番石榴库,这是ExpectedCondition所需要的。 一旦我将它添加到项目中,它按预期编译。