Tuesday, April 26, 2011

Distinguish obsolute path and relative path in QTP & How to access them..?

Absolute path means we have to mention full path in script.
Example: ExecuteFile "E:\project name\libraries\main.vbs"

Relative path means the path which you want to access from the rootfile you need.
Example: ExecuteFile "main.vbs"

But here if you want to convert this Absolute file path as Relative path. Steps to produce:

Tools->options->Folder->check the checkbox "Relative path ...."
here you have to add this path example "E:\project name\libraries"

then you can use direct filename as above mentioned in the relative path example instead of absolute path example.

Basically it's good to prefer relative path as, if the location of the root folder changes you do not get any errors.

No comments:

Post a Comment