QTP - Working with Object Repository (2024)

QTP - Working with Object Repository (1)

'; var adpushup = adpushup || {}; adpushup.que = adpushup.que || []; adpushup.que.push(function() { adpushup.triggerAd(ad_id); });

Adding Objects into OR

After Spying the object, adding the objects into Repository is the first step. The script can execute successfully if and only if the objects are added into the Object Repository. Upon Clicking "Add Objects to OR", the objects are added into Object repository.

Even when a user does a recording, the objects and its properties are captured automatically. Hence, we are able to replay the script successfully.

Object Repository – Features

Step 1 − After adding objects to the OR, we can verify by navigating to "Resources" → "Object Repository". The Object Repository Window opens and we can locate the added object in the Repository as shown below −

QTP - Working with Object Repository (2)

Step 2 − One can add the properties additionally apart from the default ones by clicking the "+" button and remove it using the "x" button. If we want to restore the defaults, we can click on the "circular arrow" button.

QTP - Working with Object Repository (3)

Step 3 − One can change the object's name. Here the name of the object is "Numbers" that can be renamed to "num", which will not have any effect on identifying the object uniquely. If there is a change in logical name, the same name should be used while scripting. Only the Object's Name can be changed and not its properties.

QTP - Working with Object Repository (4)

Note − Properties of any object must be unique so that QTP will be able to recognize the objects and act on it. If the object properties were same for two or more objects, then during execution an error would be thrown that "More than one object is matched for the specified properties".

Step 4 − After adding the objects, the same can be used in script by simple drag-drop as shown in the figure. When the object is dragged and dropped, the default operation is set. For example, click for a button, Set for a Text Box etc.

QTP - Working with Object Repository (5)

qtp_object_repository.htm

Advertisem*nts

';adpushup.triggerAd(ad_id); });

QTP - Working with Object Repository (2024)
Top Articles
Latest Posts
Article information

Author: Terrell Hackett

Last Updated:

Views: 6112

Rating: 4.1 / 5 (52 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Terrell Hackett

Birthday: 1992-03-17

Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

Phone: +21811810803470

Job: Chief Representative

Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.