This tutorial introduces Ordinal Identifiers .It is recommended you complete Tutorials 19 , 20 & 21 before taking this tutorial.
Adobe Flash Player not installed or older than 9.0.115!
points to note:
If mandatory and assistive properties are insufficient to identify an object during record session ,QTP uses Ordinal Identifier in addition to other captured properties to identify the objects during a record session
By default, an ordinal identifier type exists for each test object class.
In the Object Identification Window, you can modify the default Ordinal Identifier for an Object
There 3 types of Ordinal Identifiers
1) Index based
2) Location based
3) Creation Time
Index Based
When using Index based ordinal identifier, while recording , QTP will assign a value to INDEX property of an object
The value is based on the order in which the object appears within the source code.
The first occurrence has value 0
Index property values are object-specific.
Therefore, if you use Index:=3 to describe a WebEdit test object, Quick Test searches for the fourth WebEdit object on the page.
Likewise , you use Index:=1 to describe a WebButton test object, Quick Test searches for the third WebButton object on the page
Location Based
When using location based ordinal identifier, while recording , QTP will assign a value to LOCATION property of an object to uniquely identify the object.
The value is based on the order in which the object appears within the window, frame, or dialog box, in relation to other objects with identical properties.
The first occurrence of the object is 0.
Values are assigned in columns from top to bottom, and left to right.
Creation Time
When using creation time ordinal identifier, while recording , QTP will assign a value to CreationTimeproperty of an WebBrowser
The Identifier is only available for the Web Environment
This value indicates the order in which the browser was opened relative to other open browsers.
The first browser that opens while recording receives the value CreationTime=0 and succeeding browsers are give values 1 , 2 , 3 … an so on
Resources
Download the Webpages used in the above tutorial for self - practise.