Relevant for: GUI tests and components
When testing applications with multiple identical objects, UFT assigns an ordinal identifier to each test object. This may lead to unreliable object identification. However, it may not (immediately) result in a failed step.
To improve object identification, you can create a visual relation identifier, which is a set of definitions that enable you to identify the object in the application according to the relative location of its neighboring objects.
You can select neighboring objects that will maintain the same relative location to your object, even if the user interface design changes. This enables you to help UFT identify similar objects much as a human tester would, and helps create more stable object repositories that can withstand predictable changes to the application's user interface.
Example: If you are asked to identify identical twins sitting at different desks in a classroom, and told that:
- Twin A carries a blue bag, and Twin B carries a red bag.
- Each twin has an assigned desk partner, and they always sit next to that partner, even if they sit at a different desk.
You can identify each twin by their bag color and desk partner.
UFT uses visual relation identifiers in a similar manner. It compares the relative locations of the test objects you defined in the visual relation identifier with the multiple identical objects.
UFT uses visual relation identifiers only when one or more objects match the test object's description properties during the identification process. If no objects in the application match the test object's description properties, then the visual relation identifier you defined is ignored, and UFT continues to Smart Identification (if defined for that test object class).
When you select a related object as a horizontal and/or vertical relation
UFT identifies the related object as in line even if the area of the related object surface is only partially in line with the test object.
The following example illustrates how UFT identifies related objects that are in line with the test object to identify.