I hope you all are already aware about "selectWindow" command and all other previously published selenium IDE examples. If you have not viewed them then visit this link to view all examples step by step. I think "openMultipleWindow" command will be new for most of selenium IDE users. Yes because "openMultipleWindow" is not built in command of selenium IDE but we can get its support by attaching user extension file with selenium IDE.
"openMultipleWindow" command
First of all let me tell you function of "openMultipleWindow" command. It will open multiple windows as specified in target column of "openMultipleWindow" command. Value field will be used to set prefix window id of all new opened windows. Let me describe it with example.
Steps to download and install user extension file
First of all you need to copy user extension file code from this link.and paste it in text file and then save it as Userextension-openMultipleWindow.js on your hard drive. Now attach this file with selenium IDE as user extension to get support of "openMultipleWindow" command. This link will show you the steps of attaching user extension files with selenium IDE if you don't know. After attaching user extension file with selenium IDE, restart selenium IDE window.
"openMultipleWindow" Example
I have created one simple example of "openMultipleWindow" command as bellow to understand it. Run it in your selenium IDE. This example will open 2 windows and then it will show you how to operate on both of windows. However you can view examples of other methods to handle multiple windows in selenium IDE.
New Test | ||
Command | Target | Value |
openMultipleWindow | 2 | prefix= mywindow |
selectWindow | mywindow1 | |
open | http://only-testing-blog.blogspot.com /2013/10/table.html | |
selectWindow | mywindow2 | |
open | http://only-testing-blog.blogspot.com /2013/09/testing.html | |
selectWindow | mywindow1 | |
runScript | javascript{alert("mywindow1 is selected and selenium will do some action on it.")} | |
highlight | name=fname | |
pause | 2000 | |
type | name=fname | 1st Window |
pause | 2000 | |
selectWindow | mywindow2 | |
runScript | javascript{alert("mywindow2 is selected and selenium will do some action on it.")} | |
highlight | name=fname | |
pause | 2000 | |
type | name=fname | 2nd Window |
pause | 2000 | |
runScript | javascript{alert("Now Selenium will close both the windows")} | |
closeMultipleWindow | 2 | mywindow |
You can try above example with more than 2 windows with your software application.
No comments:
Post a Comment