Monday, 26 March 2012

Object Identification Configuration in QTP

As most of us are aware of that the Object Identification plays a major role in Automation Testing. So, it's important to know the details about the different Object Identification types.

Generally we have 20-30 different properties for an object. But QTP uses around 3-4 properties to uniquely identify the objects. By default QTP has some default properties for each environment to identify the objects. If those properties are not sufficient we can configure some more properties to identify the objects.

We have the following types of Object Identification mechanisms or methods.
Normal Identification Mechanism: In this mechanism we have Mandatory properties and Assistive Properties. QTP will read all mandatory properties at one shot to identify the objects uniquely. If those properties are not sufficient it'll take first Assistive Property and progress. It'll be keep on going until the object is identified uniquely.
Assume that the objects are not identified uniquely based on the Mandatory and Assistive Properties. Then it'll go for Smart Identification mechanism.

Smart Identification Mechanism: This is helpful to identify the objects in a unique manner if the Normal Identification is not enough. In Smart Identification we have Base Filter and Optional Filter Properties.First QTP will read the Base Filter Properties as a whole and try to uniquely identify the objects. If not required it'll add the first Optional Filter Property and proceed further.The same process will be continued until the object is uniquely identified.

We need to remember that the Smart Identification is optional and mainly used to avoid the Ordinal Identifiers.

Ordinal Identifiers: Assume that the Normal identification and Smart Identification are not enough to identify the objects uniquely.Then we have one more option called Ordinal Identifier. We have 3 types of Ordinal Identifiers.

  • Location: This is mainly based on the location in AUT. Location number usually starts from zero.
  • Index: This represents the sequence of the programs which are opened. This also starts from zero.
  • Creation Time:This represents the loading time of the objects.It starts from zero.
Global Settings: We can't have Global settings in QTP as it's a standalone application. To overcome this we have an option to make the settings same across n-number of installers.

We have settings in 3 places.
  1. File > Settings
  2. Tools > Options
  3. Tools > Object Identification
Once the settings are configured we need to generate the scripts and share it with the team members.So, the tool will be launched with the same settings across n-number of installers when the script is executed.


Post a Comment

Back To Top