The same Repeat action used for repeating over a fixed count or data rows can be used to loop of elements. First, you need to define a locator that can return multiple elements. When recording or capturing elements, we do not capture anything that returns more than one result. To define a locator that returns multiple elements, you will need to select the Inspector view on the browser window.
From there, you can define and test your locator using the Search panel at the top right. If your locator returns multiple elements, which is the goal here, then it will no longer show element details, but instead a list of elements that were found. Once your locator has been testing, click Add This Element at the bottom then the locator is ready.
Now, we need to define our Repeat action to use the new locator. In the Repeat action, set the loopMode to Page Elements. Select your new locator for targetLocator and the function you wish to execute for each iteration. Lastly, it is recommended to set an Output name. For this example, I will use the Output name 'anchors'.
Each iteration of your function now has a reference to the current page element in the loop via a context variable named element. Since we defined an Output name of anchors, we can reference the context variable as anchors_element. If you pass that context variable to any action that uses a locator, it will use the located element instead of looking up a new one.
Let me know if that makes sense
cm