How to load a object repository in QTP during runtime?
Answers were Sorted based on User's Feedback
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 |
Answer / guru
StrPath = "D:\FrameWork\Repository\GoogleHomePage.tsr"
RepositoriesCollection.Add(StrPath)
Is This Answer Correct ? | 25 Yes | 2 No |
in real time when we are creating the script by default it is going to save in action object repository or not any way my question is in one of my interviewer said that in real time the default object repository is action object repository and by using quick test plus they are going to merge is it correct i said that by selecting the object repository as shared one in selecting the test>>settings>>resources but she is not convinced what is the correct one
Can we create test script with out Step Generator?
How can we log a defect in Testdirector from Q.T.P ?
How can we retrieve the links from a web page where links are dynamically changing(for eg take a online shopping website) and then we have to click on all the links present in the webpage and go to the repective pages and again come back to the first page..
What are the environment variables?
how can we test the Triggers, Cursors, Indexes while doing Database testing in DTP??
How to get align property of the link on web page?
if we can find the status of script in qtp that either it's pass or fail then why we need to put this status on different excel file or log file in hybrid framework .please let me know asap thanks
How to remove associated function library?
what is main diff of qtp8.2 and qtp9.0?
What are the problems / difficulties faced when you used Smart Identification ?
What is an other way of "Wait" statement in QTP I dont want to use wait("Some number"). Can any one tell this please..........