bunnmatt
bunnmatt

Reputation: 817

SoapUI - Load test properties in a file from the command line

As described in the documentation at http://www.soapui.org/test-automation/running-from-command-line/load-tests.html it is possible to run SoapUI from the command line and pass in properties using the P flag as a series of name/value pairs.

I have a large number of properties to pass in - is it possible to load these from a single file rather than as multiple flags passed to the loadtestrunner script?

Upvotes: 0

Views: 1618

Answers (2)

inetphantom
inetphantom

Reputation: 2594

Please note SiKing's answer.

You can do the same from the pom.xml by adding the following configuration to the soapui-maven-plugin:

      <configuration>
        <soapuiProperties combine.children="append">
          <property>
            <name>soapui.properties.TestSuite1</name>
            <value>testsuite1props.properties</value>
          </property>
        </soapuiProperties>
      </configuration>

I did not test it for TestSuite imports, but the global ones work:

      <configuration>
        <soapuiProperties combine.children="append">
          <property>
            <name>soapui.properties</name>
            <value>global.properties</value>
          </property>
        </soapuiProperties>
      </configuration>

According to some posts it should also work for project properties:

      <configuration>
        <soapuiProperties combine.children="append">
          <property>
            <name>soapui.properties.Project1</name>
            <value>Project1props.properties</value>
          </property>
        </soapuiProperties>
      </configuration>

Upvotes: 0

SiKing
SiKing

Reputation: 10329

As per documentation:

An extended possibility to override/set properties at the project/testsuite/testcase/mockservice level is also available by adding a soapui.properties.=pathtopropertiesfile value to the global or system properties, where shortened-name-of-object is the name of the corresponding object with only characters. For example if you have a TestSuite in your project named "TestSuite 1", you can set -Dsoapui.properties.TestSuite1=testsuite1props.properties which will load the properties in the specified file ("testsuite1props.properties") into the "TestSuite 1" TestSuite properties (please note that any TestSuite names "TestSuite 1" in any of your projects will be affected).

Upvotes: 1

Related Questions