Working with the multiple windows in selenium IDE is not hard. Many selenium IDE users asking me for this question so let me try to explain it. You need to handle multiple windows many time of software applications regression testing using selenium IDE or any other tools. As you all knows, selenium IDE is not too muchpowerful tool compared to others software testing tools like Webdriver, we have to handle few things manually in selenium IDE. Bellow given case is not fully recorded but updated few commands manually after recording. Let we look at the example.
|clickAndWait||css=#gb_2 > span.gbts|
|clickAndWait||css=#scpt1 > a|
Handling Multiple Windows Test case explanation :
- Selenium IDE will open 'bing' home page.
- "storeTitle" will store bing home page title in variable 'i' to reuse it latter.
- "openWindow" will open Google home page in new window and next pause command will pause selenium IDE for 5 secs.
- Now we want to do some actions on newly opened window but we can not do any thing directly in new window. First of all we have to select new window. Next "selectWindow" command will select new window of Google home page.
- Next command will click on Google's image link.
- Now suppose i want to do some actions on parent 'bing' home page window. Before selecting parent window, "storeTitle" command will store latest title of page in variable 'j' so It will help selenium IDE to find this child window again when you want to perform some action on it.
- Next commands will select parent 'bing' window and click on image link. (You can do more actions here.)
- "selectWindow" command will select child window and next close command will close popup window.
- Last 2 commands will do same thing on parent window.
Keep one thing in mind during navigating between multiple windows of software application - Before leaving current selected window, Always store latest window title of your current selected window and then select other windows. You can try above case with some other sites.