Count Number Of Matching Elements: ELEMENTCOUNT
The Count Number Of Matching Elements action is used to determine the count of matching elements for a specified locator on a webpage. This action is helpful when you need to verify the presence of multiple elements, such as a list of items, buttons, or any other repeated components.
Example: Suppose you’re automating a page displaying products, each with an “Add to Cart” button. You’d like to know how many such buttons (or products) are visible.
Steps to configure:
- Select Count Number Of Matching Elements from the Action drop-down.
- In the Screen Name field, specify the screen (e.g., “Product Listing”).
- In the Element Key field, enter the locator key for the “Add to Cart” buttons.
- In the Parameters section, input a variable name (e.g., cartButtonCount) to store the count result.
Note: While the steps are the same in both views, the display may vary slightly.


Note: Ensure that the Screen Name and Element Key are pre-defined before using this action.
Expected Outcome on Execution:
- The Count Number of Matching Elements action will calculate and store the number of “Add to Cart” buttons in the variable , reflecting the total count of matching elements.
- This variable can be used in later steps of your automation process to reference the stored information using the syntax ${VariableName} (e.g., ${cartButtonCount}).