Forum Discussion
7 Replies
Sort By
- nmraoChampion Level 3It is a bit confusing.
The link you mentioned has step to retrieve the environment name using groovy only.
And the command line option you mentioned is to set the environment.
So, do not understand the problem.- stefOccasional Contributor
Dear Rao,
When the SoapRunner.bat is used to run a test, the environment can be supplied using that -E command line parameter.
Now inside my test, I want to use a groovy script to retrieve the value for this -E command line parameter so that I can determine the environment. This environment is then used by the script script to do some specific business logic. (I don't want to use the saved selected environment from the project, but I want to use this value.)- nmraoChampion Level 3do you mean testrunner.bat?
- stefOccasional ContributorIndeed. TestRunner.bat
Sorry for the confusion.- nmraoChampion Level 3Ok. testrunner will inject the envrionment name that you needed from command line.
And you already know how to access environment name in the groovy script based on the link you provided in the question i.e.,
testRunner.testCase.project.getActiveEnvironment().name
Hope it is clear and no confusion.- stefOccasional Contributor
I don't think that statement
testRunner.testCase.project.getActiveEnvironment().name
is not correct.
I have the feeling that the value saved in the project-url is overwrting the value on the command-line.
I'll do some more testing.
Related Content
- 10 months agolodecesa