Sometimes there are series of objects with same class name
and properties. If native, assistive and identification 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 to easy access of the Image property. An
Ordinal Identifier assigns a numerical value to the test objects which
indicates its location or order relative to its group. The Ordered value
enables QTP to recognize it uniquely when the inbuilt properties are NOT
sufficient to do so.
In the Object Identification Window, we can modify the default
Ordinal Identifier for an Object
There 3 types of Ordinal Identifiers
- Index based
- Location based
- Creation Time
Index Based Identifiers
An object appearing first in the page/Window will
have a smaller Index value when compared to another object that comes later in
the same page/Window.
- When we use Index based ordinal identifier, when we start 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
- The values of Index properties are purely object specific.
- Therefore, if we want to assign Index:=3 to describe a WebEdit test object, Quick Test searches for the fourth WebEdit object on the page. Likewise, If we use Index:=1 to describe a WebButton test object, Quick Test searches for the second WebButtonobject on the page
Location Based Identifiers
- When we use location based ordinal identifier and start recording on an application, 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 similarly like Index Property
- Values are assigned in columns from top to bottom, and left to right.
Creation Time Identifiers
- When we use creation time ordinal identifier and start recording an application, QTP will assign a value to CreationTime property of an WebBrowser
- This Identifier is only available for the Web Environment
- This value indicates the order in which the browser was opened relating to other already open browsers.
- The first browser that opens while recording receives the value CreationTime=0 and succeeding browsers are given values 1,2 ,…….
No comments:
Post a Comment