WilliamU
11 years agoNew Contributor
Getting the TestRunner environement
I have a need to retrieve the value for the -E flag (-EProd, -EBeta, etc.) from within a groovy script. I'll start off by saying that
There is unfortunately is no getter for this. So, from within a teardown script, how could I go about getting the value of this? I WOULD like to find it on some kind of project/suite/runner wide variable (i.e. runner.properties["endpoint"]). I would NOT like to have to access a particular testcase to get it (i.e. runner.testCase.properties["endpoint"]). Thank you!
testSuite.project.getActiveEnvironment().getName()does not give me the value. It gives me the value that the project file currently has saved, not the value TestRunner overrides with (which makes sense). I ran through your source and the "SoapUITestCaseRunner" class is what handles the cmd line parsing. It sets the environment to a private variable:
public void setEndpoint(String endpoint)
{
log.info( "setting test endpoint to [" + endpoint+ "]" );
this.endpoint = endpoint.trim();
}
There is unfortunately is no getter for this. So, from within a teardown script, how could I go about getting the value of this? I WOULD like to find it on some kind of project/suite/runner wide variable (i.e. runner.properties["endpoint"]). I would NOT like to have to access a particular testcase to get it (i.e. runner.testCase.properties["endpoint"]). Thank you!