Environment variable in test script command line
On our design, we use test script with command line option.
The command line is supposed to have an environment variable inside it.
For example: %LOCATION%\script.sh.
Meaning, the location of the script depends on the value of the environment variable.
I couldn't find a way to execute this command line with environment variable. Tried %VAR%, $VAR and etc.
Is there a way to do that?
|
One answer
My suggestion is to print all the execution variables in a loop and check if the required variable is getting listed or not |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
I'm a bit confused with what you want to achieve. If you want to execute %LOCATION%\script.sh, shouldn't you just pass a value (path) to the environment variable LOCATION? Also, how do you execute your test script?
The value of LOCATION can be changed, actually it is different between our machines. So I can't know in advanced what will be the value.
We will trigger the test suite via an automatically tool (Jenkins) but I think it doesn't matter.
I'm confused. You'd better explain your use case in more details. For example, from which machine do you trigger the test script? On which machine does your test script run? What environment variables does your test script receive (you can simply dump all the variables and check)?
OK. I will try.