Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting/saving Object Repository

Status
Not open for further replies.

steffencrespo

Programmer
Jun 17, 2008
1
0
0
US
I am automating tests in HP thin clients and actually I'm facing kind of a trouble with the object repository.
When I export the script to a zip file the repository does not go with the zipped file.

My script has a "main" control action and "sub" controlled reusable actions, which one having their own repository.

I tried to merge reps. into one and it apparently did ok, but when I exported the file and imported to another pc, to avoid unlocated components error while starting QTP I copy-pasted the repository, but some of the objects from the repository weren't found anyway along the script runtime.

How do I include the rep. into the exported zip file, or how do I make the script to recognize objects at once instead of having to update the repository from target application every time before running the script?
 
This is what I did:

1. Go to where the script resides. Let's say on the C: drive.
2. Create a directory called Lib.
3. Open the script that has the original OR (Object Repository) that you want.
4. Within QTP click on the OR icon or (Ctrl+R).
5. Click File > Export Local Objects
6. Export the OR to that Lib directory you just created.
7. Name this new file, Library.tsr

Now when you move your scripts or make copies of the script, open the new script and associate it to that Library.tsr file.

1. Open the new QTP script.
2. Click Resources > Associate Respositories
3. Click the +
4. Locate the Library.tsr file
5. This will move it down into the Available Actions area.
6. Highlight it there and hit the > to move it over to Associated Actions.
7. Save

Note: Be careful if you are using a mapped drive name for a shared drive that your team will be using.

Example:

Let's say that the library.tsr file is on a shared drive and your computer sees that shared drive as Z: but your teammate has it mapped as T:.

Best thing to do is to find out the long name of this shared drive. EX: //Shared/drive

And rename the respository location in your script from:

Z:/BLAH-BLAH/QTP_Script/Lib

To:

//Shared/drive/BLAH-BLAH/QTP_Script/Lib

Hope that answers your question.

SBsteve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top