-1

I have a base class in which I setup the driver and mention implicit wait of 15 seconds

driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);

Now in my test class I want to use webdriver wait for a particular element and I declare my webdriver wait as follows

WebDriverWait wait = new WebDriverWait(driver,30); wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.id("a")));

But what happens is that when my code only waits for 15 seconds on the above line, where as it should wait for 30 seconds

Sanjay Bhatia
  • 47
  • 2
  • 11

1 Answers1

0

as I understand it, this is correct behaviour

simple solution is not to use implicit waits and use only explicit

more detailed answer can be found here, it's from Jim Evans (member of the Selenium team) https://stackoverflow.com/a/15174978/2818711

Marek
  • 438
  • 5
  • 10
  • not using implicit wait is not an option for now. However I saw the suggestion in the above link that turn off implicit wait and then use webdriver wait but that is also not working for me. If I turn off implicit wait then it immediately throws exception that element is not found – Sanjay Bhatia Apr 12 '21 at 06:36