At times, it is possible that an element under consideration, may not have any unique attributes of its own or may be the unique attributes are dynamic and not suitable to be used. For the purpose of building element identification, accelQ allows complete flexibility of utilizing attributes belonging to the neighborhood nodes in the DOM tree. You can include either one or more ancestors or direct descendants of the node, as part of an element identification.
Consider the following example. We are trying to setup identification for New Password element.
In the screenshot below, you can see that the element itself does not have any attributes that can give uniqueness. There are 3 elements of type, Password.
Now, in screen 2 below, user clicked on Ancestor 2 (A2). As seen in the text, with the selected attributes (id = newPass), you can achieve uniqueness. This ancestor has functionally meaningful attributes that can bring uniqueness.
You can now add this Ancestor node as part of the selector and create a unique identification for th e element.
Adding ancestor or descendant nodes as part of selector
If an element does not present any attributes to find uniqueness, follow this process in the element explorer.
Click on an immediate ancestor node to see if there are any unique attributes that can be utilized. As soon as you click on a node in the element explorer, system automatically calculates the possible new match-count if the new node added to selector. You can select/de-select attributes of this node just like the Element node.
If desired uniqueness is achieved with selected attributes, you can add this node as part of the element's identification selector. If a node is part of the Selector, it is indicated with a fill circle of blue background in the node tree.
If uniqueness is not achieved, try to navigate to the next ancestor or descendant node and repeat this analysis.
Note: The Element node itself must always be part of the selector.
Note: If the actual ancestor level (A1, A2, A3 etc.) changes at the time of test execution, system will auto detect and find the right element.