0 votes
1 view
in Devops and Agile by (19.8k points)

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.

1 Answer

0 votes
by (63.4k points)

A simple approach would be waiting for some "particular" text on that final page, see the "waitForText" command for further info on it. To add more to this approach, you can use the Selenium wait mechanism to check whether the elements on your final page are present or not using the below code:

Java:

WebDriverWait wait = new WebDriverWait(webDriver, 10); // seconds

wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("foo")));

Ruby:

wait = Selenium::WebDriver::Wait.new(timeout: 10) # seconds

wait.until { driver.find_element(id: "foo") }

This will properly follow any redirects involved. Check the Readme.txt file:https://github.com/prabhpreetk/selenium-google-code-issue-archive

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...