Skip to content

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:

  1. Select Count Number Of Matching Elements from the Action drop-down.
  2. In the Screen Name field, specify the screen (e.g., “Product Listing”).
  3. In the Element Key field, enter the locator key for the “Add to Cart” buttons.
  4. 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.

scrn-count-number-of-matching-elements-tabular-view
Tabular View
scrn-count-number-of-matching-elements-card-view
Card View

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}).

Back To Top