The last few UFT One tutorials have been extremely important from concepts point of view. In tutorial #7, we discussed about Classes, Objects, Properties and Methods. In tutorial #8, we studied the differences between Native and identification properties in UFT. In tutorial #9, we learned about object repository and different types of object repositories in UFT. In this tutorial, we will learn the complete object identification process
in UFT.
Object identification in UFT goes through four sequential stages. If in any of the stage, a unique object is identified, it won’t go to the remaining stages.
- Learned Description (also knows as Description Properties)
- Visual Relation Identifiers
- Smart Identification
- Ordinal Identifier
The complete process is depicted in an infographic below.
Let us understand each of these four stages and the process depicted in the infographic.
1. Learned description
In the first stage, UFT identifies an object using a combination of mandatory and assistive properties. This combination of mandatory and assistive properties is known as Learned description
(also sometimes referred as description properties or test object description).
Mandatory properties are the properties that are always recorded when UFT learns an object. Assistive properties are the optional properties that are recorded only when UFT is unable to create a unique object description using mandatory properties alone. An important point to note here is that, during a run session, UFT looks for objects that match all properties present in the learned description, it does not distinguish between properties that were learned as mandatory properties and those that were learned as assistive properties.
At this stage during a run session, if a unique object matches the learned description, it means that object is successfully identified. If none of the objects match the learned description, the run session errors out. However, if several objects match the learned description, the object identification process is handled by the second stage.
2. Visual Relation Identifiers
In this stage, UFT checks if Visual Relation Identifiers
(VRI) are defined.
VRI is a set of definitions that enable you to identify the object in the application according to the relative location of its neighboring objects. For example, say you have two Submit buttons on web page. The first Submit button is next to an OK button and the second Submit button is next to Cancel button.
As a subject matter expert (SME), you are aware that OK button would always occur to the left of first Submit button irrespective of where the buttons appear in a web page. So, if say, in the next iteration, the order of these buttons gets reversed on the web page.
UFT will still be able to identify the first Submit button (in the first image above), uniquely since it still appears next to the OK button.
Now if a unique object is identified, the flow is complete. If however, VRI was not defined OR several/none of the objects get identified using VRI, the object identification process is handled by the third stage
3. Smart Identification
In the 3rd stage, UFT checks if Smart Identification
is defined and enabled.
Smart Identification is an object identification mechanism wherein UFT uses a combination of fundamental properties of a test object class AND some optional properties to identify an object. We will discuss Smart identification in-depth in the next tutorial.
Again, if a unique object is identified, the flow is complete. If a unique object is still not identified, there can be two possibilities 1) VRI was defined in the earlier stage 2) VRI was NOT defined in the earlier stage.
- VRI Defined: If VRI was defined but still UFT was not able to uniquely identify an object, the test errors out.
- VRI Not Defined: If VRI was not defined, the object identification mechanism moves to the fourth stage.
4. Ordinal Identifiers
This is the last stage of object identification process. In this stage, UFT checks whether ordinal identifiers
are defined.
Ordinal identifier assigns the object a numerical value that indicates its order relative to other objects with an otherwise identical description. Going back the earlier image, if ordinal identifier is defined for Submit button. The first Submit button would get the index value as 1 and the second button would get the index value as 2. As long as these buttons appear in the same relative order on a web page, UFT will be able to identify the objects uniquely.
If a unique object is identified, the flow is complete. If there is no ordinal identifier defined, OR if several or no objects are identified, the flow is complete without identifying an object, and UFT errors out.
Trivia: VRI has been recently introduced in the UFT object identification mechanism. Learned description, Smart Identification and Ordinal Identifiers are the oldies. We have seen them since the oldest versions of QTP. (since around 2005)
Thus we conclude the tutorial on object identification process. In the text tutorial we discuss in detail about Smart Identification.
Download the above infographic as a PDF file and stick to your desk for easy accessibility.
Here is the link to the previous tutorial: Tutorial #9: Object Repository and different types Of Object Repositories
one of the best article on Object Identification…
Haven’t seen this kind of explanation for object identification in my 7 yr career as an automation tester…
@Kailash: Thanks a lot for your kind words. They mean a lot to us and keeps us going.
Hi I am trying to record an application which is installed on remote server and also my UFT is on that server. When i record that application . I get somethinbg below
Window(“Program Manager”).WinListView(“SysListView32”).Activate “FlightsGUI – Shortcut”
. And when i run object is not identified.
Also i can notice that when i record the whole desktop screen is getting recorded and not the application which i want to record?
Any help please?
@Paul: We have discussed 5 ways to launch applications using QTP/UFT Please have a look.