What is Object Identification and Smart Identification In UFT/QTP ? with examples

Object-Identification in UFT QTP

Its all about Objects in UFT. Everything which are visible are known as objects. Such as Text, Images, Edit Boxes, Lists and so on. Now, how does UFT identify these objects uniquely ? We will find out in this post.

All objects, have their set of  properties defined by the developer while designing the application . We are familiar with properties like ‘Name’, ‘ID’, ‘Class’ etc. Similarly, there are other properties like ‘html Id’, ‘Inner text’, ‘Outer Text’ etc. From the list of available properties of the object, any one of them or combinations are used for ‘Object Identification’.

Object identification is placed under Tools/Object Identification

object identification in UFT

 

Environment :

The list of all available environments are listed under ‘Environment’. Do you remember the UFT add ins we discussed in “Add-Ins” post in UFT ? All of those installed add-ins are listed here.

Test Object Classes :

On selecting the environment , list of all available classes of the environment are displayed. for e.g, Standard windows in the above image has WinButton, WinCalender, WinEdit etc. For Web environment, classes as browser,page,images etc are shown.

Mandatory Properties :

Mandatory properties are first set of all the available properties that UFT considers while adding object into repository. User can modify the list of properties using “Add/Remove” button. These are predefined in UFT.

Assistive Properties :

If UFT cannot identify the properties of the object with the use of ‘Mandatory Properties’, then it tries to identify with the help of ‘Assistive Properties’. User can modify the list of properties using “Add/Remove” button. Also, “Up” and “down” arrows are used to set the priorities for properties.

Add Mandatory properties in UFT

 

Ordinal Properites:

If UFT cannot identify the object using both ‘Mandatory’ and ‘Assitive’ Properties, then it goes to Ordinal Properties. There are three types of ordinal identifiers ‘Index’, ‘Location’, ‘Creation Time’ for identify the object uniquely. Refer here “Object Repository” post for clear example on ordinal identifier.

Ordinal Identifier in UFT

 

Smart Identification:

UFT considers smart identification when the regular object identification cannot identify the object.  It has ‘Base Filter’ and ‘Optional Filter’ properties which are not changed by the developer at all . The only time these properties get changed is when the complete feature or requirement changes. See examples listed below.

Enable Smart Identification – needs to be checked to enable and unchecked to disable.

 

Smart Identification in UFT QTP

In order to configure these properties click on ‘Add/ Remove’ and include the properties required.

Smart Identification Properties in UFT QTP

 

 User Defined:

In user defined case, we can map an unidentified object class to a standard window class. we can define the class name, and select the class you want to map it to and add.This option available only with ‘Standard Windows’ environment.

User Defined for Object identification in UFT QTP

 

To Summarise :

  1. It sets mandatory and assistive properties for each object class.
  2. It provides an option to enable or disable Smart Identification.
  3. It defines the ordinal identifiers.

EXAMPLES :

1. Consider a FAN of company Compton Greaves which is of 3 blades (some fans do have 4 blades) with a dimension of 1200mm :  3 blades and 1200mm form the ‘ Mandatory properties‘ which are saved to identify.

2. If there are two fans of same specs 3 blades,1200mm and same company, then the ‘color’ or ‘speed’ of the fan is taken into consideration and these are know as ‘Assistive properties‘. This combination of both mandatory and assistive properties are saved.

Note : Tool starts adding the assistive properties one by one to the description until it has a unique object description ready. The properties are picked in the order they are defined in the list.

3. If for suppose, all of the properties are identical for both the fans , 3 blades, 1200mm, CG, Brown color, 250 r.p.m etc. then the ‘Ordinal properties‘ come into picture like ‘ Creation Time’ (Date of manufacture), Index etc.

4. Now, if it cannot identify the object using any of the above , then ‘Smart Identification‘ feature helps to identify the object which include Voltage input, Current etc which cannot be changed.

So, Here we come to the end of object identification concept in UFT QTP. If you have any queries, please let me know in the comments below.

  • Kumar

    Thank you. Very nice explanation.
    I have one query. –
    In general practice – SI is normally disabled while adding objects to OR ? or is it enabled all the time ? I mean If UFT doesn’t identify an object – only then we enable SI in Obj identification and then add that particular object to OR? Once after that do we disable the SI again ?

  • Indira Debarki

    So the purpose of the Object Identification is to identify the object uniquely during run time. Virtual object is also used when uft can not find the object. Then what i sthe difference between virtual object and Object Identification.