How to load a object repository in QTP during runtime?

Answers were Sorted based on User's Feedback



How to load a object repository in QTP during runtime?..

Answer / nath .t

we can add object repository at runtime

Two ways are there u can add

1. when u write below syntax in Action1

Syntax: RepositoriesCollection.Add(Path)
Ex: RepositoriesCollection.Add(E:\OR\ObjRes.tsr)

if write in Action1 it will automatically add the Object
Respository to the Action1
(i.e Edit Menu-->Action-->Action Properties-->Associate
Repository tab) at runtime.

no need to add the object repository before running.

2. Add the object repository at runtime by using AOM
(Automated Object Model)

Ex:
Dim qtAppn
Dim qtObjRes

Set qtAppn = CreateObject("QuickTest.Application")
qtAppn.Launch
qtAppn.Visible = True

qtApp.Open "E:\Test\Test2", False, False
Set qtObjRes = qtApp.Test.Actions
("Login").ObjectRepositories

qtObjRes.Add "E:\OR\ObjRes.tsr", 1

The above example Add the Object Repository(ObjRes.tsr) to
the "Login" action in Test2.

Here also no need to add the object repository in Test2.

Is This Answer Correct ?    67 Yes 5 No

How to load a object repository in QTP during runtime?..

Answer / guru

StrPath = "D:\FrameWork\Repository\GoogleHomePage.tsr"
RepositoriesCollection.Add(StrPath)

Is This Answer Correct ?    25 Yes 2 No

Post New Answer

More QTP Interview Questions

in qtp how can we do test when the build is not ready

3 Answers   Mindlance,


if the excel sheet specified in script is not there,we get run time error how to handle the error ,please anybody explain me in detail

2 Answers   Quinnox,


what type of scripts are asked in qtp?

2 Answers  


WHAT IS THE SIZE OF OBJECT REPOSITORY USING IN YOUR COMPANY? Can any body tell me answer of this quation........

11 Answers   Ness Technologies,


Explain about business process component? types and usage?

0 Answers  






how do you remove object repository at runtime and load object repository and verify it

2 Answers   Thomson Reuters,


My Application is a client server application , but there is one functionality , when we click on one particular icon it launches web browser . When I am recording in QTP , By select approprait web add in also , it not able to record in web page , I am able to record till click on the icon. Please provide me how to over come this type of problem.

2 Answers  


How to recognize and read data from pdf file using Descriptive Programming in QTP?

1 Answers   Satyam,


How can we get a textcheckpoint in QTP9.1?

2 Answers   EmTechPro,


How to identify the objects using descriptive programming when the object property values are same, i mean in a page 10 objects are there i want to click the 6th object but all the object property values are same? using descriptive programming

2 Answers   Genpact,


What is the standard timing delay for web based application in qtp?

0 Answers  


how do u prepare Test Environment ?

1 Answers  


Categories