Providing environment-specific properties
A common requirement when running SoapUI tests from scripts is to be able to provide different hostnames, ports, and file paths for different test environments. This recipe shows some easy ways to do this.
How to do it...
We'll look at two different ways to set the endpoint for Test Request
TestStep
in SOAPMock-soapui-project.xml
. For the examples, assume that there is a mock service that is running http://localhost:9001/mockInvoicePortBinding
. Perform the following steps:
Perhaps, the simplest way is to use the
–e
endpoint parameter to override theTest Request TestSteps
endpoint, for example:./testrunner.sh -e http://localhost:9001/mockInvoicePortBinding <chapter3 samples>/SOAPMock-soapui-project.xml
Another more flexible way is to set the endpoint using a property, for example:
Add a project-level property:
Use a property expansion to set the
TestSteps
endpoint:Provide the value for the property using
–Pname=value
:./testrunner.sh -Pendpoint...