Is it possible to determine if SoapUI (ReadyAPI) is started
- via testrunner.bat
- by the user (running in interactive UI-mode)
I know that you can retrieve the current environment using this groovy script code:
def env = testRunner.testCase.testSuite.project.activeEnvironment.name
However I wonder what value this will return when running via the command-line (testrunner.bat) ; will it return the active environment from the test project, or will it be null/empty ?
Update (use-case)
The user case is that depending on the way the tests are run. In case of testrunner.bat
I want to be able to set the environment to a fixed value. Else I want enable the user to select the environment manually.
Note that the some environment settings like EndPoints for each environment are defined a pre-defined XML file.
Update (possible solution)
@albciff
On the latest version from ReadyAPI (1.9.0), this does not work as you described.
- testrunner.bat returns
SoapUIProTestCaseRunner
- running via ui returns
InProcessSoapUIProTestCaseRunner
When using this code:
def runner = com.eviware.soapui.SoapUI.getCmdLineRunner();
log.info "runner = [" + runner.getClass().getSimpleName() + "]"