It is not uncommon in a dynamic web based application, that you come across a UI field or element repeating itself. For example, on a Travel portal, you may have a “Select” button against each flight option which is presented in a Flight Results Page. During test execution, test logic may require pointing to one of the elements from the group of Repeat elements and act upon it.
In the accelQ Element Explorer, once you know that an element is a repeating element, do not attempt to determine Unique matching criterion for the selector. It is perfectly valid to form the selector to show multiple matches and then mark the element as “Repeat Element”.
When an element is marked as “Repeat Element”, you can specify an Ordinal Policy. When an element is repeating, the count of such elements is usually not constant. Ordinal Policy allows you to specify which ordinal instance of the element from the group, is pointed by default. Following policies are supported.
- First: Points to the first element in the list of Repeat elements
- Last: Points to the last element in the list of Repeat elements
- n-th from First: You can specify the instance starting from the first element
- n-th from Last: You can specify the instance starting (backwards) from the last element in the group
- Random: Points to random element instance from the group
Instance numbering is based on the diagonal distance of the element from the top left corner of the web page.
Note that regardless of the type of Ordinal Policy you select in the Element Explorer, you can always change it in the Action logic using appropriate command.