Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Object Repository
#1
Solved: 11 Years, 4 Months ago
I created a test script and now how copied part of the old test script into a new script. Now I need to be able to use tthe Object Repository (OR) from the original test script.

In my old script, I went to Resources -> OR-Manager and Saved my OR.tsr file in MyOR directory.

Then in my new script, I wen to Resources -> OR-Manager to Open my OR.tst file, but still my scrit says no OR found.

Next I went to Resources -> Associated Rep and I added my OR.tsr, but still no luck.

How do I save and reuse my originally created OR?
Is there a way, at the opening of my scripts to tell QTP which OR's to use?
Reply
#2
Solved: 11 Years, 4 Months ago Wink 
HI,

To tell QTP which OR's to use, we need to associate the repository to the script. We can add multiple repositories to a script & vice versa.

Smile
Reply
#3
Solved: 11 Years, 4 Months ago
What is the cose I would add to select which ORs I would want to use? Can I add this directly into my script?
Or, must I use QTPs menu's to add each OR as needed?

thx
Reply
#4
Solved: 11 Years, 4 Months ago
you should be able to use OR.tsr in new script. you have two options:
1. open old OR in object repository manager and copy all the objects and then paste them into new OR
2. associate old OR to new script
Reply
#5
Solved: 11 Years, 4 Months ago
Thx!

So I guess I can not associate an object repository to a script with a call to a OR.tsr. In #2, how do I associate the OR.tsr to a different script?
Reply
#6
Solved: 11 Years, 4 Months ago
In ur new script can u plz try this?

Code:
strRepPath = <path of OR>   ("c:\vIns\OR.tsr")
        RepositoriesCollection.RemoveAll()
        RepositoriesCollection.Add(strRepPath)
Reply
#7
Solved: 11 Years, 4 Months ago
vIns,

Does the statement "RepositoriesCollection.RemoveAll()" remove the currently loaded OR and "RepositoriesCollection.Add(strRepPath)" adds the one with my OR back in? Great!

I will try hopefully soon. I just am having issues building the OR with Navigate & Learn (F6).
vIns,

I added your code:
Code:
strRepPath = P:\QTP Tests\ObjectRepository\RepositoryCTE.tsr
RepositoriesCollection.RemoveAll()
RepositoriesCollection.Add(strRepPath)
but I receive an RunError message box:
The test run cannot continue due to a syntax error.
Expected statement
Line (1):
Code:
"strRepPath = P:\QTP Tests\ObjectRepository\RepositoryCTE.tsr
Reply
#8
Solved: 11 Years, 4 Months ago
Try this ma'am

Code:
strRepPath = "P:\QTP Tests\ObjectRepository\RepositoryCTE.tsr"
RepositoriesCollection.RemoveAll()
RepositoriesCollection.Add(strRepPath)
Reply
#9
Solved: 11 Years, 4 Months ago Big Grin 
Double-Quotes, I always forget these. ;-), thaxxx vIns
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Do we need object repository?? subhashinid 0 1,972 07-06-2016, 10:07 AM
Last Post: subhashinid
  Object repository losing object properties ishan.mahajan@adp.com 2 3,770 08-20-2015, 11:33 PM
Last Post: ADITI1992
  login object not found in object repository Akram 2 3,125 06-01-2015, 07:47 PM
Last Post: babu123
  object was not found in the Object Repository reynard 0 6,855 03-17-2015, 10:54 PM
Last Post: reynard
  Change Object Repository File Path for ExternalActions MasterChief 1 4,694 11-13-2014, 06:05 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 2 Guest(s)