TestProject Forum

General => Selenium => Topic started by: Jordan on July 19, 2016, 17:15:34 pm

Title: Selenium wait for transition page to redirect before running assertion
Post by: Jordan on July 19, 2016, 17:15:34 pm
I have a procedure that loads a transition page, and then that page redirects to another page, which takes time to load.

I want to run assertions on the second page (not the transition one). How do I tell Selenium WebDriver to wait until the second page loads before performing the assertions?
Title: Re: Selenium wait for transition page to redirect before running assertion
Post by: Dimitri on July 20, 2016, 16:11:50 pm
An easy way to do this would be to waitForElement or waitForText that is supposed to appear on your 2nd page
this way you can be certain you're on the right page before running any assertions
Title: Re: Selenium wait for transition page to redirect before running assertion
Post by: Jordan on July 21, 2016, 18:41:24 pm
That could work

Haven't thought of that
Thanks!