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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relative path in QTP 1

Status
Not open for further replies.

QTPer

Programmer
Jun 6, 2006
29
US
Hi,

How do I specify a relative path in QTP?

I have the following typical setup :

All my actions, reusable or otherwise are stored in a particular shared folder on a network.

I create a reusable action ActionA and save it in the shared folder of say CompShare. The shared folder is mapped to S:\> drive on CompA, now I create a TestA which uses ActionA. Now I open TestA on another box CompB(Shared folder is mapped to Q;\>), here I get an error message saying that ActionA has not been found.

I have resolved the above issue by setting the folder options to look at the right place. I did this by specifying the total path where the ActionA is located. I had been using absolute path till now but it is proving to be too tedious.

Is there a better way to do it??

In case any further clarification is needed please voice it.

Cheers,
QTPer
 
set the path using the shared server name, rather than the drive mapping. The server name won't change whichever machine you use.

Cheers,
Dave

"Yes, I'll stop finding bugs in the software - as soon as you stop writing bugs into the software." <-- Me

For all your testing needs: Forum1393
 
Dave,

Thanks for the solution. But, I have to point here the 'Shared Server Name' again, in a way, is an absolute path, isn't it?

Say I have a shared server name ShareServ and folder called libs in it. If you are suggesting me to set path in the following way \\ShareServ\libs, then I have been doing it with considerable success rate.

I was actually thinking of setting a relative path which draws lines from Java in which we set the JavaHome in Environment variables and after that we that use a path which almost looks like this ..\libs. Is there anyway?? :D

Thanks once again for your valuable suggestion.

Cheers,
QTPer.
 
Create an INIT script to initialise your setup, reload yuor function libraries etc. specify a constant here and give it the absolute server path.

Call this script before your actual test scripts and you'll be able to use the constant throughout the scripts.

If you need to change the actual server in use, change the constant.

You can't assign an arbitrary relative path unless you can be absolutely certain that any machine you use will map to the server in question in exactly the same way as you have coded it (which would be contrary to your original posting)

Cheers,
Dave

"Yes, I'll stop finding bugs in the software - as soon as you stop writing bugs into the software." <-- Me

For all your testing needs: Forum1393
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top