How to use “selectWindow” and “waitForPopUp” Commands example in selenium

“waitForPopUp” Command
Remember one thing that selenium IDE software automation testing tool can handle only one window at a time. When you are taking some action like clicking on link or button and open new popup window then how to handle it in selenium IDE software automation tool? “selectWindow” command will help you to select window but before that you need to verify that your expected window is open or not. “waitForPopUp” command will help you to wait until your expected window is not open.
You can give JavaScript window “name” of the window in to target of “waitForPopUp” command. If you leave target blank or “null” then “waitForPopUp” will wait for the first non-top window to appear. Put

timeout period into value field for how much time to wait for popup. If you are working with multiple popups then don’t rely on this command.

In bellow given example, “waitForPopUp” command will wait for the popup window for 30 seconds.
New Test
Command Target Value
open http://www.software-testing-tutorials-automation.com/
type name=email youremailid @xxx.com
click css=input[type=”submit”]
waitForPopUp 30000
selectWindow title=FeedBurner Email Subscription
assertTitle FeedBurner Email Subscription
verifyTextPresent Thank you for your request
“selectWindow” Command
When you are working with multiple windows then “selectWindow” command is useful to select any window. You can use software web application’s window title or internal JavaScript “name,” or JavaScript variable of that window in target field.
In above given example, “selectWindow” command will find window with title=FeedBurner Email Subscription and select that window to perform all next actions.
If you will give target as a null then again selenium IDE software tool will select main window. “selectPopUp” Command is very similar to “selectWindow” command.

6 thoughts on “How to use “selectWindow” and “waitForPopUp” Commands example in selenium

  1. You can use "close" Command to close the popup window. It will close only current selected window. So if you want to close popup window then first of all select it using selectWindow command and then close it

  2. Hi,

    I tried to execute this command but I am facing some issue in 'assertTitle' command. When I execute this, I get error that is '[error] Could not find window with title FeedBurner Email Subscription'. But it appears on the Top of the window. Please suggest me.

  3. Hi Padmaja! Maybe.. You can to use: setSpeed | 3000| on this moment …until the element to show. Or.. waitForFrameToLoad | id= id_popup_or_content_body .
    I have a example in my application, just like:


    waitForFrameToLoad | id=content
    windowsFocus | title = title_popup
    or
    selectWindow | title = title_popup

    I hope have helped you!

Leave a Reply

Your email address will not be published. Required fields are marked *