I used
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(60));
wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.linkText("Home"))));
But in wait.until line it throws below error when running the code.
java: method until in class org.openqa.selenium.support.ui.FluentWait cannot be applied to given types; required: java.util.function.Function<? super org.openqa.selenium.WebDriver,V> found:
org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement> reason: cannot infer type-variable(s) V (argument mismatch; org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement> cannot be converted to java.util.function.Function<? super org.openqa.selenium.WebDriver,V>)
I tried all the solutions in until in FluentWait cannot be applied - java but no avail. Thank you.
CodePudding user response:
In my case, when I update selenium-firefox-driver as below solved the issue. Earlier, I had 3.141.59.
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>4.1.4</version>
</dependency>