how do you remove object repository at runtime and load
object repository and verify it
Answers were Sorted based on User's Feedback
Answer / ravindra
'Adding Repository to an action
'*********************************************************************
Dim qtApp,qtRepositories, actName, RepPath
RepPath=".TRS File Path"
actName=Environment.Value("ActionName") 'Get Action Name
Set qtApp = CreateObject("QuickTest.Application") ' Create Application Object
Set qtRepositories = qtApp.Test.Actions(actName).ObjectRepositories ' Get Associated repositories list
If qtRepositories.Find(RepPath) = -1 Then
qtRepositories.Add RepPath, 1 ' Add the Object Repository to the current action
End If
qtApp= Nothing
qtRepositories= Nothing
'*********************************************************************
'*********************************************************************
'Remove repository from an action
Dim qtApp,qtRepositories, actName, RepPath, rPosition
RepPath=".TRS File Path"
actName=Environment.Value("ActionName") 'Get Action Name
Set qtApp = CreateObject("QuickTest.Application") ' Create Application Object
Set qtRepositories = qtApp.Test.Actions(actName).ObjectRepositories ' Get Associated repositories list
rPosition=qtRepositories.Find(RepPath) 'Find the Position of the Repository
If rPosition<>-1 then
qtRepositories.Remove rPosition ' Remove Repository From the Action
End if
qtApp= Nothing
qtRepositories= Nothing
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / uday
This you can do in two ways:
Use "RepositoriesCollection" utility object and use below
methods as per your needs.
RepositoriesCollection.remove(pathOfSharedOR)
RepositoriesCollection.add(pathOfSharedOR)
RepositoriesCollection.add(pathOfSharedOR)
Another way is using AOM.
A bit of coding is needed, so i am putting high level
overview. I am just posting a pseudo code here:
create a QTPObject
Get associaterepositories by some method like
"AssociatedRepositories"
set repositories=QTPObject.AssociatedRepositories
Once you have repositories you can use below methods like
repositories.remove (path)
repositories.add(path)
repositories.find(path)
I hope that helps.
Thanks,
Uday
http://qtpftvideos.blogspot.com/
| Is This Answer Correct ? | 1 Yes | 5 No |
Can I record on netscape browser does it require any special settings ?
Diff B/w Webserver and Client Server
How can we count the no of rows are available in a data table ?
What is the difference between byref and byval in qtp?
What is 'sleep' in sync point?
What is the main difference between QTP 8.0& QTP 9.2.And what r the features and benefits of QTP.
how can u put synchronization point in qtp,wat is exactly synchroniztion why we use it wat is benifit in qtp
13 Answers College School Exams Tests, Mind Tree,
How can i select multiple items from a WebList bOX USING QTP
any body plz send health care domain project to me with explanation any two modules on that project. mail_id: ranjith_99reddy@yahoo.co.in
Kindly help me with the following queries.. -- How to recognize webtable using QTP and how to use it? -- How would one conclude that it is a web table -- For Example, if there is a web table and I am clicking on say Cell A1, how would i know that i've clicked on cell A1 -- Kindly suggest me to use the web table better
Tell me one scenario, the complex functionality you have automated in your project?
How to call actions in QTP?