Can I wait with Selenium Web Driver for a long time period?
Even though I can set implicitlywait command like below, it doesn't wait the time that I've given.
driver.manage().timeouts().implicitlyWait(5, TimeUnit.MINUTES);
Is there anything wrong here?
In my case, I need to execute one test case and wait for 4 minutes and then execute the next test case.
I use Java here.
Considering you need to wait for a particular element i'd do something in the lines of a ExplicitWait like below.
WebDriverWait wait = new WebDriverWait(driver, 300); // The int here is the maximum time in seconds the element can wait.
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("someId")));
On this case you can use any of the ExpectedConditions you'd like. Also not having to use a big wait time on some very particular cases. This imho is a good practice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With