Import and export QTP scripts via relative paths?
Has anyone tried to setup and run QTP from a relative location rather than the default location of C:\Program Files\Mercury Interactive\QuickTest Professional\Tests to ease checking in and checking out scripts? More specifically, we're checking our zip files into CVS, but my manager wants us to simplify this process i.e. unzip the zip files into respective directories and have QTP point to this new QTP home when running/creating/editing QTP scripts. Has anyone experiment with this? Thanks in advance.
Re: Import and export QTP scripts via relative paths?
I have successfully done this using QTP (9.2) only. I don't know what the issues might be if you are also using TD/QC with QTP.
As for QTP here are the issues you need to address:
1. Of course, all references in your code and libs need to be ..\..\blah. This will be simple if you used a "standard" structure for your technology, project, suite and test(s) hierarchy--and ugly if not.
2. All libs included on the Test Settings Resource tab, and those including using the ExecuteFile() statement need to be path relative. Again this is pretty apparent.
Now for the stuff I stumbled over:
3. You need to include any shared ORs path relative. I can't remember if I had to remove absolute references in order to correct to path relative. Note that QTP always "suggests" fully qualified pathnames.
4. You need to include all calls to shared Actions path relative. I KNOW I had to remove those that were inserted using fully qualified in order to re-insert using path relative references. Here again QTP always "suggests" fully qualified pathnames. Here is a thread that provides more details on this issue:
I am now able to run a suite of tests on either my C:/blah/blah/etc "root", any other "root" I chose on C: and have validated this further by installing and running the suite on a network drive using an arbitrary directory. The "any directory root on C:" is probably what you are after so you can set up local development sandbox from your selected code control system.
Later this summer I am going to integrate ClearCase with the QTP dev and that is why I went through the above last month.
-Hope this helps, Terry Horwath