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 |
Iam doing automation in Oracle App's using QTP? In App's because of some functional setup, keep on changing my script flow. for this how can i use the recovery sceanrio?? Please help me?
How do you done Data-Driven Testing using MS-Word. What is the script for that
How to call a function in QTP?
I have made the recovery scenario in script. When i am exceuting the script. it stop automatically after running recovery scenario. Please tell the resaon?
Hi, I want to write the script for a webpage. But i didn't added the properties of the objects to the object repository. Without adding the object properties to the object repository, how to write the script. When i am writing the script, Let us say i typed as Browser (""). after selecting ".", if the object is added to the object repository it will display atomatically. But in my case it is not as i didn't added the object properties. How to proceed further in the above mentioned case to write the script manually. Pls let me know if you didn't understand the question.
What is the diff between doing parametarisation using Data Driven wizard or manually. when do we go for manual para...and when do we use Data driver wizard..can anybody answer it ..Thanks in advance
How many types of parameters are there in QTP and what are they?
How can I check if a environment variable exist or not?
On a web application I want to select list item 5 from a dropdown list. but QTP identifying this object as winobject. Then how can we select list item 5 from that dropdown list.
How you are developing the script? Using record and play back or manual?
What is meant by Pseudo Code?
I have written some scripts in QTP by using older version, but I want to run them in latest version. Is there any process to do that.If so can anyone explain me?