HomeSelenium

New Selenium IDE – Using ‘store xpath count’ command

New Selenium IDE – Using ‘store xpath count’ command

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

store xpath count is one of the commands in Selenium IDE.

The purpose of the store xpath count command is to retrieve and store the count of the UI elements located using the given XPath Locating strategy into a variable in Selenium IDE.

In this article, I am going to practically demonstrate store xpath count command in Selenium IDE to retrieve and store the count of UI elements on the page that got located using the given XPath locating strategy into a variable and then print the value stored in the variable.

Let’s get started.

New Selenium IDE – store xpath count command

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

1) Let’s write the below code in Selenium IDE to retrieve and store the count of UI elements located using the given XPath locating strategy into a variable and then print the count stored in the variable using the ‘echo’ command.

Note: I have given the XPath locating strategy for locating the all the hyperlinks on the page using xpath=//a XPath locating strategy.

[su_table alternate=”no”]

Command Target Value
open http://omayo.blogspot.com/
store xpath count xpath=//a x
echo ${x}

[/su_table]

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

store xpath count Selenium IDE - typing

2) Run the test and observe that the test will be passed and the count of UI element located using the given XPath locating strategy will be stored into a variable and then printed in the ‘Log’ tag as shown below:

store xpath count Selenium IDE - executed

Here concludes the practical demonstration of store xpath count command in Selenium IDE for retrieving and storing the count of UI elements located using the given XPath locating strategy 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