[SoapUI] SoapUI命令行方式运行
https://www.soapui.org/test-automation/running-from-command-line/functional-tests.html
TestRunner Command-Line Arguments
To run functional tests from a command line, you use the testrunner.bat/.sh file that is located in the <SoapUI>\bin folder. The runner uses the following command-line arguments:
-
a : Commands the runner to export all generated test results. If you skip this argument, the runner will export only error messages.
-
A : Commands the runner to organize files with test results into directories and subdirectories that match the test suites and TestCases the runner executes.
If you skip the -A argument, the runner will save all result files to the directory that the -f argument specifies. The file names will include the test suite's and test case's names.
The runner can ignore this attribute depending on the -R command-line argument value.
-
c : Specifies the TestCase to run. Use this argument to narrow down the tests to be executed. If you do not specify this argument, the runner will launch all the tests that relates to the parent test suite.
-
D : Specifies a value of a system property for the test run. The specified value will override the variable's value during the run. Usage:
-D=
. If the value includes spaces, enclose the entire argument in quotes. To override several variable values, specify the -D argument several times. -
d : Specifies the domain that the simulated requests will use for authorization. This argument overrides the authorization domain specified in your test properties.
-
e : Specifies the endpoint to use in test requests. The specified endpoint should include the protocol part (for example,
https://
).This argument overrides the endpoints specified for TestSteps in your test project. See also description of the -h argument.
-
E : Specifies the environment to use in the test run (SoapUI Pro only).
-
F : Specifies the format of the exported reports. Usage:
-F<FormatName>
. Supported formats include PDF, XLS, HTML, RTF, CSV, TXT and XML. If the parameter is not specified, PDF is used.To export results in several formats, separate them with commas. For example,
-FPDF,XML,CSV
.The runner can ignore -F argument depending on the value of the -R argument. See the description of this -R argument below.
To export results in various formats, you need a SoapUI Pro license. Sign up for a free trial to check how it works.
-
f : Specifies the root directory, where the runner will save test result files. If the specified directory does not exist, it will be created.
Important: if the directory exists, reports’ files in it will be overwritten.
-
G : Specifies a value of a global property for the test run. The specified value will override the variable's value during the run. Usage:
-G<variable>=<value>
. If the value includes spaces, enclose the entire argument in quotes. To override several variable values, specify the -G argument several times. -
g : Commands the runner to generate a coverage report (HTML format). To use this argument, you need a SoapUI Pro license. Sign up for a free trial to check how it works.
-
h : Specifies the host and port to use in test requests. Usage: -h<host>:<port>. You can specify the host by using its IP address or name.
This argument overrides endpoints specified in the project file. See also description of the -e argument.
-
I : Commands the runner to ignore errors. If you put this argument to the command line, the test log will contain no information on errors that occur during the test run. If you skip this argument, the runner will stop the run on the first error that occurs and will post full information about the error to the log.
-
i : Commands to the runner to enable UI-related components. Use this command-line argument, when you use the UISupport class in your tests.
-
J : Commands the runner to create JUnit-style reports with test case properties in them. Meaningful only if the -j argument is also specified (see below).
-
j : Commands the runner to generate JUnit-compatible reports. This argument is similar to the -R"JUnit-style HTML Report" command-line argument.
-
M : Commands the runner to create an XML file with brief test results. This argument does not depend on the other command-line arguments that concern result export: -F, -R and -A.
-
m : Sets the maximum number of TestStep errors to log for each TestCase.
-
o : Commands the runner to open the generated reports in your default web browser after the test run is over. To use this functionality, you need a SoapUI Pro license. Sign up for a free trial to check how it works.
-
P : Specifies a value of a project property for the test run. The specified value will override the variable's value during the run. Usage: -P<variable>=<value>. If the value includes spaces, enclose the entire argument in quotes. To override several variable values, specify the -P argument several times.
-
p : Specifies the password to use during the run for authorization. This argument overrides the authorization password settings specified in your test project.
-
R : Specifies the type of the report data. Usage: -R. Report type can be one of the following:
- TestCase Report - Generates a report in the format that is specified by the -F argument. The runner will save the report files to the directory that the -f argument specifies. Depending on the -A argument value, the files can be organized into subdirectories.
- JUnit-Style HTML Report - Generates a report as JUnit-style HTML files. See JUnit-Style HTML Reports. When this value is used, the runner ignores the -F and -A arguments.
- Data Export - Generates XML files with report data. When you use this argument, -F must be XML or must not be specified.
Use the -f argument to specify the directory, where the runner will save generated report files.
Note that to use reports in your tests, you need a SoapUI Pro license. If you do not have it, sign up for a free trial to try how it works.
-
r : Commands the runner to include a summary report into the test log.
-
S : Commands the runner to save the test project after the test run finishes. This command-line argument may be useful, if you store data during the test within the project.
-
s : Specifies the test suite to run. if you skip this argument, the runner will execute all the test suites in your project.
-
t : Specifies the workspace settings filed to be used during the test run. If you skip this command-line argument, the runner will use the default file – soapui-settings.xml - that is located in your user directory.
Use this argument to specify another settings file for the run. It helps you use different proxy, SSL, HTTP and other settings without changing them in your test project.
See also description of the -v argument.
-
u : Specifies the user name to be used in test request authorizations. This argument overrides user names specified in your test project.
-
v : Specifies the password for your settings XML file. See also description of the -t argument.
-
w : Specifies the WSS password type. Usage: -w<password type>, where <password type> is of the following:
- Text - Corresponds to the PasswordText WSS password type.
- Digest - Corresponds to the PasswordDigest WSS password type.
-
x : Specifies the project password, in case the project is encrypted.
Examples
- The following command runs all functional tests from the specified project:
testrunner.bat "c:\my projects\my-project.xml"
- The following command runs the 'my test case' TestCase in your project and creates HTML files in a JUnit-style format:
testrunner.bat -FPDF -R"JUnit-Style HTML Report" -c"my test case" c:\my projects\my-project.xml
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 25岁的心里话
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
2014-07-23 [Selenium]通过Selenium实现在当前浏览器窗口点击一个图标之后,弹出另外一个窗口,关闭这个窗口,再回到原来的窗口进行操作