Time for action – complex working with multiple windows - Selenium

In the next example we are going to open up two pop-up windows and move between them and theparent window as it completes its steps.

  1. Start Selenium IDE and go to Chapter(Getting Started with Selenium IDE)on the website.

  2. Click on the Click this link to launch another window link. This will launch a pop-up window.

  3. Assert the text on the page. We do this by right-clicking and selecting assert Text.

  4. Go back to the parent window and click on the link to launch the second pop-up window.

  5. Verify the text on the page.

  6. Move to the first pop-up window and close it using the close link. As before, be aware of click And Wait instead of click.

  7. Move to the second pop-up window and close it using the close link.

  8. Move back to the parent window and verify an element on that page.

  9. Run your test and watch how it moves between the windows. When complete it should look like the following screen shot:

What just happened?

We just had a look at creating a test that can move between multiple windows. We saw how we can move between the child windows and its parent window as though we were a user.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Selenium Topics