SoapUI - 从命令行加载文件中的测试属性
SoapUI - Load test properties in a file from the command line
如 http://www.soapui.org/test-automation/running-from-command-line/load-tests.html 的文档中所述,可以从命令行 运行 SoapUI 并使用 P
标志作为一系列 name/value对。
我有大量属性要传入 - 是否可以从单个文件加载这些属性而不是作为多个标志传递给 loadtestrunner
脚本?
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).
请注意。
您可以通过将以下配置添加到 soapui-maven-plugin
来从 pom.xml 执行相同的操作:
<configuration>
<soapuiProperties combine.children="append">
<property>
<name>soapui.properties.TestSuite1</name>
<value>testsuite1props.properties</value>
</property>
</soapuiProperties>
</configuration>
我没有针对 TestSuite 导入测试它,但全局导入有效:
<configuration>
<soapuiProperties combine.children="append">
<property>
<name>soapui.properties</name>
<value>global.properties</value>
</property>
</soapuiProperties>
</configuration>
根据一些帖子,它也应该适用于项目属性:
<configuration>
<soapuiProperties combine.children="append">
<property>
<name>soapui.properties.Project1</name>
<value>Project1props.properties</value>
</property>
</soapuiProperties>
</configuration>
如 http://www.soapui.org/test-automation/running-from-command-line/load-tests.html 的文档中所述,可以从命令行 运行 SoapUI 并使用 P
标志作为一系列 name/value对。
我有大量属性要传入 - 是否可以从单个文件加载这些属性而不是作为多个标志传递给 loadtestrunner
脚本?
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).
请注意
您可以通过将以下配置添加到 soapui-maven-plugin
来从 pom.xml 执行相同的操作:
<configuration>
<soapuiProperties combine.children="append">
<property>
<name>soapui.properties.TestSuite1</name>
<value>testsuite1props.properties</value>
</property>
</soapuiProperties>
</configuration>
我没有针对 TestSuite 导入测试它,但全局导入有效:
<configuration>
<soapuiProperties combine.children="append">
<property>
<name>soapui.properties</name>
<value>global.properties</value>
</property>
</soapuiProperties>
</configuration>
根据一些帖子,它也应该适用于项目属性:
<configuration>
<soapuiProperties combine.children="append">
<property>
<name>soapui.properties.Project1</name>
<value>Project1props.properties</value>
</property>
</soapuiProperties>
</configuration>