What is Object Identification in QTP and How It Works ? - TestingQ.com

-->Exclusive Portal for Testing Jobs

What is Object Identification in QTP and How It Works ?

When you add or record any Object from the application, QuickTest "looks" at the object on which you are recording and stores it as a test object, determining in which test object class it fits. QuickTest classify the test object as a standard Windows dialog box (Dialog), a Web button (WebButton), or a Visual Basic scroll bar object (VbScrollBar), for example.
Then, for each test object class, QuickTest has a list of mandatory properties that it always learns. When you add or record on an object, QuickTest always learns these default property values, and then "looks" at the rest of the objects on the page, dialog box, or other parent object to check whether this description is enough to uniquely identify the object. If it is not, QuickTest adds assistive properties, one by one, to the description, until it has compiled a unique description. If no assistive properties are available, or if those available are not sufficient to create a unique description, QuickTest adds a special ordinal identifier, such as the object's location on the page or in the source code, to create a unique description.
Similarly, during a run session, QuickTest searches for a run-time object that exactly matches the description of the test object it learned while recording. It expects to find a perfect match for both the mandatory and any assistive properties it used to create a unique description while recording. As long as the object in the application does not change significantly, the description learned during recording is almost always sufficient for QuickTest to uniquely identify the object. 
If QuickTest is unable to find any object that matches the learned object description, or if it finds more than one object that fits the description, then QuickTest ignores the learned description, and uses the Smart Identification mechanism to try to identify the object. 
If QuickTest is unable to find any object using smart identification then QuickTest uses Combination of Learned description and ordinal identifiers to find the object uniquely.

Object Identification Dialog box (Navigation: - Tools--> Object Identification)
Using Object Identification dialog box we can

  • Configure the properties for each class
  • Selecting the Ordinal Identifier
  • Configuring smart identification
  • Creating user defined classes
In object Identification Dialog box you can find list of classes, for every class you can find pre-configured Mandatory and assistive properties.
Mandatory properties are properties that QuickTest always learns for a particular test object class.
Assistive properties are properties that QuickTest learns only if the mandatory properties that QuickTest learns for a particular object in your application are not sufficient to create a unique description. If several assistive properties are defined for an object class, then QuickTest learns one assistive property at a time and stops as soon as it creates a unique description for the object. If QuickTest does learn assistive properties, those properties are added to the test object description.
If the combination of all defined mandatory and assistive properties is not sufficient to create a unique test object description, QuickTest also records the value for the selected ordinal identifier.

Ordinal Identifier
In general, there are two types of ordinal identifiers:
Index—indicates the order in which the object appears in the application code relative to other objects with an otherwise identical description.
Location—indicates the order in which the object appears within the parent window, frame, or dialog box relative to other objects with an otherwise identical description. Values are assigned from top to bottom, and then left to right.
The Web Browser object has a third ordinal identifier type:
CreationTime—indicates the order in which the browser was opened relative to other open browsers with an otherwise identical description. Each test object class has a default ordinal identifier selected.


Configuring Mandatory properties
In object identification dialog box select the object class from test object classes list and go to Mandatory properties for that class.
Click on Add/Remove button and select or deselect the properties you want to configure.

Configuring Assistive Properties
In object identification dialog box select the object class from test object classes list and go to Assistive properties for that class.
Click on Add/Remove button and select or deselect the properties you want to configure.

Configuring Ordinal Identifiers
To modify the selected ordinal identifier, select the desired type from the Ordinal identifier box.
Smart Identification
When QuickTest uses the recorded description to identify an object, it searches for an object that matches every one of the property values in the description. In most cases, this description is the simplest way to identify the object and unless the main properties of the object change, this method will work.

If QuickTest is unable to find any object that matches the recorded object description, or if it finds more than one object that fits the description, then QuickTest ignores the recorded description, and uses the Smart Identification mechanism to try to identify the object.



To receive daily posted JOBS & Interview Questions
Just enter your email address below and click 'Submit'
Enter your email address:

Make sure to activate your subscription by clicking on the activation link sent to your email