No Such Method error while using implicitlyWait(Duration.ofSeconds(10)

142 Views Asked by At
ava.lang.NoSuchMethodError: 'org.openqa.selenium.WebDriver$Timeouts org.openqa.selenium.WebDriver$Timeouts.implicitlyWait(java.time.Duration)

This error is coming when I removed deprecated implicit wait to latest one.

Please any one provide me a solution to resolve this.

To launch a browser successfully

1

There are 1 best solutions below

0
On

The current notation for implicitlyWait uses the Duration.ofSeconds(n) as the unit of time and can be implemented as follows:

import java.time.Duration;
import org.openqa.selenium.WebDriver;

driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));