HomeSelenium

New Selenium IDE – Using ‘store attribute’ command

New Selenium IDE – Using ‘store attribute’ command

Refer the article New Selenium IDE – Commands (Selenese), for the complete list of Selenium IDE commands and their practical demonstrations.

store attribute is one of the commands in Selenium IDE.

The purpose of the store attribute command is to retrieve and store the value of the given attribute name of the located UI element into a variable in Selenium IDE.

In this article, I am going to practically demonstrate store attribute command in Selenium IDE to retrieve and store the value of the given attribute name of the located UI element into a variable and then print the value stored in the variable.

store attribute Selenium IDE - demo

Let’s get started.

New Selenium IDE – store attribute command

Follow the below steps for practicing store attribute command in Selenium IDE along with me:

1) Let’s write the below code in Selenium IDE to retrieve and store the value of the given attribute of the located UI element into a variable and then print the value stored in the variable using the ‘echo’ command.

Note: I have given the id locating strategy id=but2 for locating the UI element shown at the beginning of the article.

Also, observe that along with the above id locating strategy, we need to append the attribute name to the locating strategy with @ symbol as shown below: (i.e. attribute name who’s value needs to be retrieved – id=but2@type)

[su_table alternate=”no”]

Command Target Value
open http://omayo.blogspot.com/
store attribute [email protected] x
echo ${x}

[/su_table]

After incorporating the commands in the above table, our Selenium IDE should look like below:

store attribute Selenium IDE - typing

2) Run the test and observe that the test will be passed and the value of the given attribute name of the located UI element will be stored into a variable and then printed in the ‘Log’ tag as shown below:

store attribute Selenium IDE - executed

Here concludes the practical demonstration of store attribute command in Selenium IDE for retrieving and storing the value of the given attribute name of the located UI element into a variable.

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 ?

About Me > Arun Motoori

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.

Comments (0)

Leave a Reply

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

For FREE Testing Tutorials & Videos

X
Open chat
Contact Us on Whatsapp