Selenium IDE- Using "openMultipleWindow" command and handle multiple windows

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
CommandTargetValue
openMultipleWindow2prefix=
mywindow
selectWindowmywindow1
openhttp://only-testing-blog.blogspot.com
/2013/10/table.html

selectWindowmywindow2
openhttp://only-testing-blog.blogspot.com
/2013/09/testing.html

selectWindowmywindow1
runScriptjavascript{alert("mywindow1
is selected and selenium will do
some action on it.")}

highlightname=fname
pause2000
typename=fname1st
Window
pause2000
selectWindowmywindow2
runScriptjavascript{alert("mywindow2
is selected and selenium will
do some action on it.")}

highlightname=fname
pause2000
typename=fname2nd
Window
pause2000
runScriptjavascript{alert("Now Selenium will
close both the windows")}

closeMultipleWindow2mywindow

You can try above example with more than 2 windows with your software application.

No comments:

Post a Comment