2

I have a link in a web page that opens a new window. The web page that opens is an external site.

What should i check on the new window to confirm that its correct? Since the site isn't my own, checking title doesn't make sense because if it's changed my test would fail.

Should I instead I check Url of the link?

I am using Selenium webdriver in c#.

3

Nothing is going to be absolutely static - for all you know, they could add a redirect, and then the URL check is no longer any good.

I'd use title if it's somewhat unique and reasonably static. Unless they're changing the title dynamically, it's probably static enough for your tests.

The goal shouldn't be to never update your tests, just to minimize maintenance.

2

Yes, check something that does not change, for example:

  • URL (as you said)
  • some text on the page that is always there (e.g. company name)
0

Best way is to check the element availability of that web page. If it contain any tables or graphs then validate the height and the width of those graphs and tables ..etc.

0

Agree with few other answers & would like to add below imp point:

  • When you are getting redirected on other web-site[external as you mentioned] That means its not targeted web-site to test & execute your automation suite.

  • But you might taking some inputs or confirmation, what is necessary for you on that page will be testing as well as assertion area. [Is it making sense?] That you should not miss in your script.

  • It might be:

    1. URL

    2. Your comapany logo or name

    3. Redirection button which will bring user back on your targeted website

    4. Just "Success" [200] response

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.