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

what is Unicoad Compatibility ???? HOw does this makes a diffrence from Winrunner.???

1 Answers   GE,


what are the Common Problems in S/w development process

1 Answers  


What In-string function will do?

1 Answers  


How to connect to oracle(sqlserver) database to QTP

3 Answers   CTS,


which command u will use to access the application through descriptive programing?

7 Answers   Datamatics,






How can we test an XML using QTP? I have been to an interview, where they have given me an XML which had 15 values and they have given those values on a separate page. They asked me to write a QTP script to check the XML is having those particular 15 values.

2 Answers  


Is QTP Supports SWT applications? If yes, can you write a sample script for opening a new package in eclipse.

0 Answers   IBM,


what is the difference between QTP 8.0 & 9.0?

4 Answers  


Did QTP prove efficient for your project? Yes or No, explain?

0 Answers  


hi how could i get installation guide for QTP 9.0 on XP help me for this !!!!!

1 Answers  


Can we record a video in qtp recording??

1 Answers   BirlaSoft,


1. What is extense of Result file in QTP?

7 Answers  


Categories