构造函数WebDriverWait(WebDriver,int)是未定义的Selenium



我在使用WebDriverWait时收到此错误消息。

它抛出以下错误消息:

构造函数WebDriverWait(WebDriver,int(未定义

WebDriverWait wait = new WebDriverWait(driver, 10); 
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("above-expath")));
element.click();

我该怎么办?它被否决了吗?

改为传递Duration

WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); 

最新更新