I am having an issue with .withTimeout(30, TimeUnit.SECONDS) can any one please suggest me.
Error: The method withTimeout(Duration) in the type FluentWait<WebDriver> is not applicable for the arguments (int, TimeUnit)
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.FluentWait;
import org.openqa.selenium.support.ui.Wait;
public class FluentWaitExample {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver","D:\\Softwares\\Selenium\\geckodriver.exe");
FirefoxDriver driver=new FirefoxDriver();
WebElement element1=driver.findElement(By.xpath("/html/body/div/div[3]/form/div[2]/div[1]/div[1]/div/div[2]/input"));
Wait<WebDriver> wait = new FluentWait<WebDriver>(driver)
.withTimeout(30, TimeUnit.SECONDS)
.pollingEvery(5, TimeUnit.SECONDS)
.ignoring(NoSuchElementException.class);
WebElement element = wait.until(ExpectedConditions.visibilityOf(element1));
}
}