I have a fairly standard situation: Click a button, it loads a transition page with a progress bar or something, and then that page redirects to the next page, which takes a while to load.
I want to run assertions on the final page, not the transition page. How do I tell Selenium IDE to wait till the final page loads before performing the assertions?
Thank you.
We can wait until the page is completely loaded in Selenium webdriver by using the JavaScript Executor. Selenium can run JavaScript commands with the help of the executeScript method.
Wait until text is present in the specified element findElement(By.id("element-id")); WebDriverWait wait = new WebDriverWait(driver, 10); wait. until(ExpectedConditions. textToBePresentInElement(element, "text")); If you go to the given link above, you will see all the wait condition there.
Explicit Wait The explicit wait is used to tell the Web Driver to wait for certain conditions (Expected Conditions) or the maximum time exceeded before throwing an "ElementNotVisibleException" exception.
A simple approach would be wait for some "particular" text on that final page, see "waitForText" command for further info on it
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