How to select the popup window on the UI
This example demonstrates how to select the popup window on the UI.
In the solution shown below, you will click on the link "Click Here" which will open a new popup window in Worksoft SaaS Training application. The switching of focus between the windows is handled using the commands "selectPopUp" and "deselectPopUp".
Solution:
# | Command | Target | Value |
---|---|---|---|
click on the "Click Here" link | |||
1 | click | //a[.='Click Here'] | |
Select the window popup using the title of the page | |||
2 | selectPopUp |
Worksoft SaaS Training New Window | |
Verify the text on the window popup | |||
3 | waitForTextPresent |
This is my New Window | |
Unselect window popup and select the main window | |||
4 | deselectPopUp |
Tips, Tricks, Gotchas & Best Practices:
- As an alternative, you can use the selectWindow command.
- You can also select the popup window using the windowID or the name of the window instead of the title.