Skip to content
Advertisement

the method withtimeout(duration) in the type fluentwait is not applicable for the arguments (int, timeunit)

An error appear while working with this code the error is

“The method withTimeout(Duration) in the type FluentWait is not applicable for the arguments (int, TimeUnit)”

Wait wait = new FluentWait(driver)    
    .withTimeout(30, SECONDS)    
    .pollingEvery(5, SECONDS)   
    .ignoring(NoSuchElementException.class);

Advertisement

Answer

This is the correct usage now..

Wait wait = new FluentWait(driver).withTimeout(Duration.ofSeconds(30)).pollingEvery(Duration.ofSeconds(30))
                    .ignoring(NoSuchElementException.class);
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement