storeXpathCount (target, pattern) - Selenium IDE command

The storeXpathCount command is used to retrieve and store the count of the UI elements located using the given XPath locating strategy into a variable in Selenium IDE. In other words, it gets the number of nodes that match the specified xpath (e.g. "//table" would give the number of tables).

storeXpathCount Example

The macro below counts all links on the page.

Command Target Pattern/Text
open https://ui.vision/docs/selenium-ide/storexpathcount
storeXpathCount xpath=//a c
echo Number of Links on Page = ${c}

Works in

UI.Vision RPA for Chrome Selenium IDE, UI.Vision RPA for Firefox Selenium IDE, Firefox IDE Classic

Related Demo Macros

DemoExtract

The ready-to-import-and-run source code of all demo macros can be found in the Github repository testmacros folder.

See also

storeText, storeTitle, Web Automation Extension User Manual, Selenium IDE commands, Classic Firefox Selenium IDE.

Anything wrong or missing on this page? Suggestions?

...then please contact us.

<em>UI.Vision RPA</em> Selenium IDE for Chrome and Firefox - Web Test Automation
Subscribe to the UI Vision RPA software newsletter . We'll send you updates on new releases that we're working on.