Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...My thanks to the contributors who freely share their knowledge and enthusiasms. This forum restores some measure of my faith in human nature..."

Geography

Where in the world do Tek-Tips members come from?
QTPer (Programmer)
6 Jul 06 14:06
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
Helpful Member!  DPlank (IS/IT--Management)
6 Jul 06 16:52
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

QTPer (Programmer)
7 Jul 06 0:34
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.
DPlank (IS/IT--Management)
14 Jul 06 6:59
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

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close