It is very common to come across web pages with multiple repeating elements in the form of a list or a set of similar items. For example, you may have a "select" button against each flight option in the flight listing page on a travel portal. In this scenario, multiple "select" buttons have similar functional purpose. Also the number of such buttons is variable based on test data or time of test execution.
Your test logic will probably require you to select one of the flights and move on from this page. When setting up identification criterion, we need to be able to mark the "select" button as a "repeat" element and try not to find unique identification criterion.
Consider the example below. Car Rental results are displayed. Every time you search for a car rental, you may get different options. "Pay Now" button is a Repeat element, as it could occur any number of times and all such buttons are functionally equivalent.
Selector should not show unique match
When you try to add this element to the Repository in accelQ, make sure to select only such attributes, so as to generically identify this class of element. Match count should not be unique. Compare and see if the match count looks to be the same as the number of these elements actually displayed on the application screen.
Notice that the element selector is set to result in multiple matches (21 in this case).
Repeat Element Index Policy
Once you mark an element as a Repeat element, you have a choice to select which instance number of this element you are specifically interested. You can choose from one of the policies below (while saving the element) or you can even update this index in your action logic.
- n-th from first
- n-th from last