I have a Selenium test that checks if a certain string can be seen on the testpage. My idea is to use an explicitwait if the page doesn't load immediately.
WebElement element = driver.findElement(By.xpath("//*[text()='text']"));
After that I did:
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.visibilityOf(element));
So it has a waiting time of max 10 seconds before continuing. If it sees the element within 10 seconds the test continues.
But i get the following error at the wait.until
until
(java.util.function.Function<? super org.openqa.selenium.WebDriver,java.lang.Object>)
in FluentWait cannot be applied
to
(org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement>)
Using google to solve this hasn't helped me. Anyone knows how to solve this error?
The element contains the String that I want