I'm trying to make function wait for an element in Selenium.
private WebElement waitIsClickable(By by, int n) throws Exception{
WebDriverWait wait= new WebDriverWait(driver,/*seconds=*/ n);
wait.until(ExpectedConditions.elementToBeClickable(by));
return driver.findElement(by);
}
But when I want use it:
waitIsClickable(By.id("logIn"), 20).click();
I get an error:
Error:(1057, 20) java: method waitIsClickable in class Functions cannot be applied to given types; required: org.openqa.selenium.By,int found: org.openqa.selenium.By reason: actual and formal argument lists differ in length