Use Pathfinder.locate utility in QTP.
In your case, Pathfinder.locate(".") will give you the path of the script which is "C:\Tests\Automation\TestScripts\Login"
if you use Pathfinder.locate("..\..\"), the path would be "C:\Tests\Automation".
To append the path of the environment variable,
RelPath = Pathfinder.locate("..\..\")
Envvarpath = Relpath & "\Data\Environment.xml"
Hope this helps.
Let me know if you need more help.
Thanks,
Elango
In your case, Pathfinder.locate(".") will give you the path of the script which is "C:\Tests\Automation\TestScripts\Login"
if you use Pathfinder.locate("..\..\"), the path would be "C:\Tests\Automation".
To append the path of the environment variable,
RelPath = Pathfinder.locate("..\..\")
Envvarpath = Relpath & "\Data\Environment.xml"
Hope this helps.
Let me know if you need more help.
Thanks,
Elango

