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.

  1. Learned Description (also knows as Description Properties)
  2. Visual Relation Identifiers
  3. Smart Identification
  4. Ordinal Identifier

The complete process is depicted in an infographic below. Object Identification Process UFT

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.

visual-relation-identifier-uft

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.

vri-order-reversed-uft

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.

  1. VRI Defined: If VRI was defined but still UFT was not able to uniquely identify an object, the test errors out.
  2. 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.

ordinal-identifier-uft

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