Monday, 28 November 2011

Object Identification in QTP

Ans: On the basises of three properties, QTP identify an object.
These property are
1) Mandatory Prop.
2) Assistive Prop.
3) Ordinal Identifier
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.
To configure mandatory and assistive properties for a test object class:
Choose Tools > Object Identification. The Object Identification dialog box opens.
Select the appropriate environment in the Environment list. The test object classes associated with the selected environment are displayed in the Test object classes list.
Note: The environments included in the Environment list correspond to the loaded add-in environments. For more information on loading add-ins, see Working with QuickTest Add-Ins.
In the Test Object classes list, select the test object class you want to configure.
In the Mandatory Properties list, click Add/Remove. The Add/Remove Properties dialog box for mandatory properties opens.
Select the properties you want to include in the Mandatory Properties list and/or clear the properties you want to remove from the list.
Note: You cannot include the same property in both the mandatory and assistive property lists.
You can specify a new property by clicking New and specifying a valid property name in the displayed dialog box.
Tip: You can also add property names to the set of available properties for Web objects using the attribute/ notation. To do this, click New. The New Property dialog box opens. Enter a valid property in the format attribute/ and click OK. The new property is added to the Mandatory Properties list. For example, to add a property called MyColor, enter attribute/MyColor.
Click OK to close the Add/Remove Properties dialog box. The updated set of mandatory properties is displayed in the Mandatory Properties list.
In the Assistive Properties list, click Add/Remove. The Add/Remove Properties dialog box for assistive properties opens.
Select the properties you want to include in the assistive properties list and/or clear the properties you want to remove from the list.
Note: You cannot include the same property in both the mandatory and assistive property lists.
You can specify a new property by clicking New and specifying a valid property name in the displayed dialog box.
Tip: You can also add property names to the set of available properties for Web objects using the attribute/ notation. To do this, click New. The New Property dialog box opens. Enter a valid property in the format attribute/ and click OK. The new property is added to the Assistive Properties list. For example, to add a property called MyColor, enter attribute/MyColor.
Click OK to close the Add/Remove Properties dialog box. The properties are displayed in the Assistive Properties list.
Use the up and down arrows to set your preferred order for the assistive properties. When you record a test or component and assistive properties are necessary to create a unique object description, QuickTest adds the assistive properties to the description one at a time until it has enough information to create a unique description, according to the order you set in the Assistive Properties list.
Ordinal Identifier 
In addition to recording the mandatory and assistive properties specified in the Object Identification dialog box, QuickTest can also record a backup ordinal identifier for each test object. The ordinal identifier assigns the object a numerical value that indicates its order relative to other objects with an otherwise identical description (objects that have the same values for all properties specified in the mandatory and assistive property lists). This ordered value enables QuickTest to create a unique description when the mandatory and assistive properties are not sufficient to do so.
Because the assigned ordinal property value is a relative value and is accurate only in relation to the other objects displayed when you record, changes in the layout or composition of your application page or screen could cause this value to change, even though the object itself has not changed in any way. For this reason, QuickTest records a value for this backup ordinal identifier only when it cannot create a unique description using all available mandatory and assistive properties.
Further, even if QuickTest records an ordinal identifier, it does not use it to identify the object during the run session, unless neither the recorded description nor the Smart Identification mechanism are able to single out the object in your application.
If the other test object properties are sufficient to identify the object during a run session, the ordinal identifier is ignored.
There are three types of ordinal identifiers that QuickTest can use to identify an object:
Index—Indicates the order in which the object appears in the application code relative to other objects with an otherwise identical description. For more information, see Identifying an Object Using the Index Property.
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. For more information, see Identifying an Object Using the Location Property.
CreationTime (Browser object only)—Indicates the order in which the browser was opened relative to other open browsers with an otherwise identical description

No comments:

Post a Comment