Refer the article New Selenium IDE – Commands (Selenese), for the complete list of Selenium IDE commands and their practical demonstrations.
store window handle is one of the commands in Selenium IDE.
The purpose of the store window handle command is to store the window using its locator i.e. tab index or title.
Note: Refer to the Solution provided by TimK in the Comments section of this article to make this command work.
Though it is practically not possible (i.e. now working) to use store window handle command in Selenium IDE to store the window using its title or tab index locator, I will explain in this article about the syntax for using the store window handle in store a window using its title or tab index locator.
Let’s get started.
New Selenium IDE – Using ‘store window handle’ command
Follow the below steps for practicing store window handle command in Selenium IDE along with me:
1) Let’s write the below code in Selenium IDE to store a window using store window handle command by using title locator as shown below:
[su_table alternate=”no”]
Command | Target | Value |
---|---|---|
open | http://omayo.blogspot.com/ | |
click | xpath=//a[text()=’Open a popup window’] | |
store window handle | title=omayo (QAFox.com) | x |
select window | x |
[/su_table]
2) We can also use store window handle command and tab index value to store a window using it by using the below sample code:
Note: tab=0 stands for the main window, tab=1 stands for first tab window to the right, tab=2 stands for second tab window to the right, tab=-1 stands for first tab window to the left of the main window and so on.
[su_table alternate=”no”]
Command | Target | Value |
---|---|---|
open | http://omayo.blogspot.com/ | |
click | xpath=//a[text()=’Open a popup window’] | |
store window handle | tab=1 | x |
select window | x |
[/su_table]
I tried in all ways and am unable to demonstrate the above-given sample codes as they are not working in my machine.
Feel free to comment in this post, if you are successful in executing any of the above tables.
Here concludes the practical demonstration of store window handle command in Selenium IDE for storing the window.
In the next article, I will practically demonstrate another Selenium IDE command.
Next Steps:
- > Check complete Selenium Tutorial Contents here (Click here)
Please leave your questions/comments/feedback below.
Happy Learning ?
On a mission to contribute to the Software Testing Community in all possible ways.
Refer the article New Selenium IDE – Commands (Selenese), for the complete list of Selenium IDE commands and their practical demonstrations.
I wrote like the way 2 you wrote in Selenium IDE.
Like this:
Click target xpath=//a[contains(@href, ‘https://abc…’)]
Store window handle target: tab =1 value: x
select window target: x
but It shows an error message:
selectWindow on x Failed:
No such window locator
Please let me know why it couldn’t run?
Thanks alot!
As mentioned in this article, there is no solution for this on the web.
Let’s wait for the Selenium Guys to provide more documentation or solution for this.
I also have this issue. Selenium IDE does not work with popup windows. which nearly every website uses. therefore Selenium IDE is no good for web solutions.
New Selenium IDE is new and is being taken care of by Applitools.com.
As everything is new, it may take some time to get into a stable state.
You can always reach Applitools.com for the support of such errors.
It is working. Just very badly documented. This works:
store window handle | randomname
select window | handle=${randomname}
Thank you Tim.
Hello I just want to share this blog which helped me able to run the Selenium IDE script in a new window. https://corevo.io/the-difficulties-of-select-window/
Selenium IDE v3 has “Modify new window configuration” option beside the Command field.
In Modify new window configuration, set the Window Name to newWindow
Here is the command sequence
Click | linkText=
select window | handle=${newWindow}
proceed with the process/transaction you want to do.
Can someone help? I’m trying to verify something in a popup window.
what am i missing?
Click linkText=homepage
store Window handle title=popup page x
select window x
It’s failing and getting a ‘No such window locator’ message when i run this script.