driver.manage().timeouts().implicitlyWait(2000, TimeUnit.MILLISECONDS); driver.manage().timeouts().pageLoadTimeout(40, TimeUnit.SECONDS); In my code, above 2 lines used and I commented the second line, it's working fine. //driver.manage().timeouts().pageLoadTimeout(40, TimeUnit.SECONDS);