Can one load a properties-file via command-line option?
Is there an option to load specific properties via a command-line option?
We need to test our code in different configurations which require to load different properties-files on top of a common soapUI-project file, i.e. the test-suites and test-cases are the same (or rather: were parameterized) but a couple of top-level properties have to be added/adjusted depending on the configuration to be tested.
I am calling soapUI from our test ant-script in the following way:
<exec executable="${testrunner.cmd}"
failonerror="yes"
failifexecutionfails="yes"
>
<arg line="-s ${suite_name} -I -r -i -j -M -f ${reportDir}-${report_name} ${soapUI.project}" />
<!-- usage: testrunner [options] <soapui-project-file> -->
<!-- -A Turns on exporting of all results using folders instead of long filenames -->
<!-- -a Turns on exporting of all results -->
<!-- -c <arg> Sets the testcase -->
<!-- -D <arg> Sets system property with name=value -->
<!-- -d <arg> Sets the domain -->
<!-- -e <arg> Sets the endpoint -->
<!-- -f <arg> Sets the output folder to export results to -->
<!-- -G <arg> Sets global property with name=value -->
<!-- -H <arg> Adds a custom HTTP Header to all outgoing requests -->
<!-- (name=value), can be specified multiple times -->
<!-- -h <arg> Sets the host -->
<!-- -I Do not stop if error occurs, ignore them -->
<!-- -i Enables Swing UI for scripts -->
<!-- -j Sets the output to include JUnit XML reports -->
<!-- -M Creates a Test Run Log Report in XML format -->
<!-- -m Sets the maximum number of TestStep errors to save for each testcase -->
<!-- -P <arg> Sets or overrides project property with name=value -->
<!-- -p <arg> Sets the password -->
<!-- -r Prints a small summary report -->
<!-- -S Saves the project after running the tests -->
<!-- -s <arg> Sets the testsuite -->
<!-- -t <arg> Sets the soapui-settings.xml file to use -->
<!-- -u <arg> Sets the username -->
<!-- -v <arg> Sets password for soapui-settings.xml file -->
<!-- -w <arg> Sets the WSS password type, either 'Text' or 'Digest' -->
<!-- -x <arg> Sets project password for decryption if project is encrypted -->
<!-- project file -->
However, that starts soapUI given a specific project file only (which contains a default set of properties) but does not add specific properties to it.
Thus, before running that script I always first need to open the project in soapUI, load the appropriate properties and save the project again (so that the project file now contains the correct default properties). Only then I can run our deploy-and-test-script.
But having to fire up soapUI each time beforehand is cumbersome, easily goes forgotten and partially defeats the purpose of having automated testing.
I know that one can set properties individually (using the -D option as described in the comment above) but we need to set a hole slew of properties each time and I want to avoid having to add these all to my test-script!