Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

How to execute a WinRunner Script in QTP?

1 Answers   Crea,


I'm facing this problem while automating my application..its a web based apps.. In my application there are few webtables are displaying in the page.In the different cells there are links and action buttons.Problem is there is link in different web tables corresponding to one name.Hence the properties of the objects(say a link) are same except the x,y co ordinate of the object.So my script is not able to distinguish between the two links present in different cells of web tables with same name.Kindly help on this..

3 Answers  


How can we log a defect in Testdirector from Q.T.P ?

2 Answers   EDS,


What is the use of environment variables?

1 Answers  


How to Identify broken links in QTP

2 Answers   Ness Technologies,






Which property do you use to retrieve or assign data into a cell in a Data Table object?

1 Answers  


can a Function return more than one value..??? if so please give me the code for that.

5 Answers   DST Global Solutions,


I have many listboxes in my application. I have to check whether the contents inside the listboxes are in sorted order or not..can anyone please send the code as early as possible

0 Answers  


Hi , I am new to VBscripting, My requirment is to write a vbscript to read a row (which has coloumns like Description, Code, date(DD/MM/YY), hours etc) and export these feilds to a Website and then click on Submit Automatically on that web page. This it should do for all the Rows in that excel file. Any help is much appriciated Thanks Shalini

2 Answers   TCS,


which is the easiest way you can send the QTP test results to Client if he want to see the screenshots when the results are failed?

1 Answers   CTS,


how to fetch the values from grid? & qtp recogniges that grid as a webelement? what u do?

0 Answers   IBM,


How to capture screen shots when an error occurs?

5 Answers   EDS,






Categories