Skip to main content

Loop through similar UI elements

Sophie avatar
Written by Sophie
Updated this week

Definition and Usage

Iterate through each item in the list of similar elements in the window. This command allows you to perform actions on multiple UI elements that share the same characteristics, such as items in a dropdown list, table rows, or menu options.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

Element

Select or capture an element to operate on

UI element

Yes

Use the Capture button to select the element

Store loop index in variable

When selected, this will automatically output the position of the current item in the list, starting from 0

Checkbox

No

Store loop item into

Store the current loop item into a new variable

Variable name

No

Outputs the current element being processed

Store loop index into

Position of the current item in the list, starting from 0

Variable name

No

Only available when "Store loop index in variable" is checked

Advanced settings

Parameter

Description

Possible Values

Required

Options / Notes

Element timeout (s)

Wait time for element to appear (seconds)

Numeric value

No

Default is 20 seconds

Loop from bottom

Loop the similar elements from the bottom of the list

Checkbox

No

When checked, iteration starts from the bottom of the list

Variables produced

This action can produce the following variables:

  • A variable containing the current loop item (UI element)

  • A variable containing the index of the current item in the loop (starting from 0)


Using Variables in Conditions

You can use the variables produced by this command in subsequent actions to perform operations on each element. The index variable can be used for conditional logic or to track the position in the list.


Notes

  • This command is useful for automating repetitive tasks on lists, tables, or collections of similar UI elements

  • The loop continues until all matching elements have been processed

  • When using this command, you should place the actions you want to perform on each element inside the loop

  • The element you select should be representative of the type of elements you want to iterate through

  • Make sure the elements are visible on screen or can be scrolled into view during execution

Did this answer your question?