Visual Relation Identifier in UFT – User friendly Tech help
n
Introduction:-
nA visual relation identifier (VRI) is a set of definitions that enable you to identify the object in the application according its neighbouring objects in the application.
n
nn
You can select neighbouring objects that will maintain the same
n
relative location to your object, even if the user interface design changes.
n
This helps UFT to identify similar objects much as a human tester would, and helps in creating more stable object repositories that can withstand predictable changes to the application’s user interface.
n
Example:-
n
Scenario1:- You need to go to Cash counter (Object) in bank; your friend told you that it is the third counter from entry.
n
Solution :- You( UFT )enters the bank, looks for Cash counter name, but sadly there are two Cash Counters one for deposit and other for withdrawal , you are confused which is the counter you have to go, than you thought of going to the third counter from entry (Ordinal Identifier concept of object identification in UFT) but bad luck again, due to some renovation in Bank, cash counter has been moved to different location, so you as UFT failed to identify the object.
n
To overcome the limitation of Scenario1, UFT comes with the feature VRI (Introduced in QTP -11.0).
n
Scenario 2:– In addition to scenario1, UFT is told that cash counter (Object) has Bank Manager Cabin on left and in the same horizontal line.
n
Solution: – UFT enters the bank, looks for the Cash counter name, but as there are two counters with the same name, now comes VRI, i.e. to look for that counter which is left of Managers cabin and finally right(Unique) counter is found.
n
Now here even renovation happens than also UFT will uniquely identify counter (with the assumption that in case of renovation also Managers, Cash counter will remain adjacent to each other irrespective of their position(Ordinal Identifier) in Bank.)
n
In testing also lot of time object position changes (Renovation happens) so VRI is more reliable than Ordinal identifier, provided that relative objects are same.
n
Place to ser VRI:-
n
You define visual relations in the Visual Relation Identifier dialog box, which is accessible from the local or shared object repository, and from the Object Properties dialog box
n
VisualRelation Identifier dialog
n
VRI usage in UFT:-
n
Step 1:- During a run session, UFT first attempts to identify the test object (Cash Counter)using the object’s description properties(Mandatory + Assistive Properties).If it fails to uniquely identify than VRI comes into picture.(Provided VRI is enabled)
n
Step2:- If UFT finds one or more objects matching the test object’s description, it attempts to identify the object using the VRI.
n
Workflowof object identification
n
Image courtesy of Ohmega1982 / FreeDigitalPhotos.net