How to fix Webdriver wait or implicitly wait deprecated message error in Selenium webdriver?

In this video we have shown how to fix below error related to implicitly wait and explicitly wait:

“Timeouts org.openqa.selenium.WebDriver.Timeouts.implicitlyWait(long time, TimeUnit unit),


Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.”


“The constructor WebDriverWait(WebDriver, long) is deprecated

3 quick fixes available:

@ Add @SuppressWarnings ‘deprecation’ to ‘wait’

@ Add @SuppressWarnings ‘ deprecation’ to ‘main()’

Configure Problem severity”

I hope you like this video. For any questions, suggestions or appreciation please contact us at: or email at:


public class DemoDeprecatedMethod {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.setProperty("", "path of chrome driver exe\\chromedriver.exe");
		WebDriver driver = new ChromeDriver();
		/* Below are depracated ones in selenium 4
		WebDriverWait wait = new WebDriverWait(driver, 120);
		/* Solution
		//WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(120));
		WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(120, 1));
		WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(120, 1));


Leave a Reply