I have been using these 2 function in Selenium, they were working fine. Now they dont, there is an error saying:
No instance(s) of type variable(s) V exist so that ExpectedCondition<WebElement> conforms to Function<? super WebDriver, V>
I have not updated Selenium nor anything else in the project. What could be the cause?
worth mentioning, the function they both reside is:
public static void safeClick(WebDriver driver, WebElement element, Boolean checkVisibility) {
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("arguments[0].scrollIntoView(true);", element);
executor.executeScript("arguments[0].focus();", element);
if (checkVisibility) {
WebDriverWait wait = new WebDriverWait(driver, 5);
wait.until(ExpectedConditions.visibilityOf(element));
wait.until(ExpectedConditions.elementToBeClickable(element));
}
executor.executeScript("arguments[0].click();", element);
}