sburkard
10 years agoOccasional Contributor
Obtain arguments given to testrunner.sh in Script
Hi
Is there a way to obtain the arguments given to testrunner.sh? For example the endpoint from the -e option or the username from the -u option?
I found in the JavaDoc that the class AbstractSoapUITestRunner has methods to obtain all these values, but I didn't found a way to get them from a Groovy script inside the project that is executed.
Thanks
Stephan
OK I finally found it.
I can obtain the runner instance through the statically accessible SoapUI class. I already tried this, but I must have overseen the getCmdLineRunner method that does the trick.
import com.eviware.soapui.SoapUI def runner = SoapUI.getCmdLineRunner() assert runner != null log.info runner.getEndpoint() log.info runner.getUsername()