Get index count

This is a pre-built Action located under the @Generic Element. The functionality of this Action in Avo Assure is to retrieve the total number of items (index count) present in a list within the AUT. The execution result is stored in the dynamic variable.

Syntax

Input Value: <variable containing list value>

Note:

  • The variable name should be enclosed within curly braces.

  • To display the variable:

    • For a 1-dimensional array, the index starts from 0, and the array count will start from the 0th index. For example, if the count is 7, it will fetch a value of 6.

    • For Desktop AppType, the index starts from 1, and the array count will start from the 1st index.

Argument
Description

<variable containing list value> (Required)

Provide a list which total number of items will be counted.

Output Value: <Dynamic Variable>;<Dynamic Variable>(Optional)

Argument
Description

<Dynamic Variable> (Required)

This dynamic variable stores the number of items present in the list.

<Dynamic Variable>

(Optional)

This dynamic variable stores the status as True or False.

Example: Retrieving the Total Number of Items in a List

In this example, we explain how to retrieve the total number of items present in a list.

  • Action: Get Index Count

Note: Before you use the Get Index Count action, make sure a previous step Get All Values from List action retrieves the list items and stores them in a dynamic variable. For example: {Values}.

  • Input Value: {Values}

    • The argument ({Values}) specifies the dynamic variable that contains the list whose total number of items needs to be calculated.

    • The stores array list in this {Values} variable is: ['HTML, 'Python', 'Java']

  • Output Value: {Count}

    • The fetched number of items (3) present in the list is stored in this {Count} dynamic variable.

    • If a second output variable is provided, then action returns the status as True or False:

      • True: if the index count is retrieved successfully.

      • False: if the action fails due to an invalid or empty list.

  • Logical Explanation: The Get Index Count action takes the list variable provided in the Input Value column ({Values}) and calculates how many items exist in that list. It stores the total number of items (3) in the {Count} variable.

Last updated

Was this helpful?