How to set Relative Path in Global Variables

Ask general questions here.
LPG
Posts: 39
Joined: Mon Jul 25, 2011 6:12 pm

How to set Relative Path in Global Variables

Post by LPG » Thu Oct 13, 2011 9:06 pm

I have set the path to the application under test as a Global Variable in my test suite. Not everyone will call their working directory the same thing, so my absolute path is not an ideal solution.

How can I make this a relative path?

I assume I need to set the "root" directory where it should start from, but where do I do this? Also, how would I refer to it in my Global Variable settings?

Thanks!

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to set Relative Path in Global Variables

Post by Support Team » Mon Oct 17, 2011 8:09 am

Hi,

to set a root directory, from which you can start a application with relative path, you have to add some code.
You can do this by adding attached user code module to your projct, which sets the current directory to the values helt in a global parameter.
You have to add this global parameter holding the absolute path of your root directory and bind it with the variable "dir" of the user code module.

Regards,
Tobias
Support Team
Attachments
setCurrentDirectory.cs
User code module which sets the current directory
(1.33 KiB) Downloaded 577 times
.
Image