soapui + groovy 接口自动化测试 第十章

testrunner.bat/testrunner.sh用法;

1.在windows下通过命令行的方式来运行soapui项目

打开命令行窗口,首先通过cd 命令进入soapui/bin目录下(cd C:\Program Files\SmartBear\SoapUI-5.1.3\bin)

 testrunner.bat -s PlanTestSuite -r -j D:\REST-AutomationProject2.0.xml  参数的含义后边介绍

有时候运行并不会成功,这是因为少一个soapui的全局配置文件,默认soapui-settings.xml位置为C:\Users\ceshi现将它复制到c盘根目录下就行了;倘若还有错误则使用-t参数指定 -t C:\soapui-settings.xml

2.在Linux下运行soapui项目

 linux下运行的参数和window下是相同的,在运行的时候带上完整的testrunner.sh所在的目录且需要制定soapui-settings.xml位置,示例:

 /data/applications/soapui/SmartBear/SoapUI-5.1.3/bin/testrunner.sh -s PlanTestSuite -r -j ${WORKSPACE}/REST-AutomationProject2.0.xml -t ${WORKSPACE}/soapui-settings.xml

因此这就要求在从windows向linux服务器上传soapui项目时要把soapui-settings.xml文件带上

3.参数

-s 指定要运行的 TestSuite
-f 指定运行结果的输出目录
-j 生成 junit 风格的 report
-r 运行完成以后打印一个简单的 summary

以下为其余的参数
e : The endpoint to use when invoking test-requests, overrides the endpoint set in the project file
h : The host:port to use when invoking test-requests, overrides only the host part of the endpoint set in the project file
s : The TestSuite to run, used to narrow down the tests to run
c : The TestCase to run, used to narrow down the tests to run
u : The username to use in any authentications, overrides any username set for any TestRequests
p : The password to use in any authentications, overrides any password set for any TestRequests
w : Sets the WSS password type, either 'Text' or 'Digest'
d : The domain to use in any authentications, overrides any domain set for any TestRequests
r : Turns on printing of a small summary report (see below)
f : Specifies the root folder to which test results should be exported (see below)
j : Turns on exporting of JUnit-compatible reports, see below
a : Turns on exporting of all test results, not only errors
o : Opens the generated report in a browser (SoapUI Pro only)
i : Enables SoapUI UI-related components, required if you use the UISupport class for prompting or displaying information
t : Sets the soapui-settings.xml file to use, required if you have custom proxy, ssl, http, etc setting
x : Sets project password for decryption if project is encrypted
v : Sets password for soapui-settings.xml file
D : Sets system property with name=value
G : Sets global property with name=value
P : Sets project property with name=value, e.g. -Pendpoint=Value1 -PsomeOtherProperty=value2
S : Sets to save the project file after tests have been run
I : Do not stop if error occurs, ignore them
R : Selects which report to generate for the test objects executed, for example if running the entire project, this could specify the name of a test-suite-level report that would be generated for each TestSuite. The report is saved as specified with the -F option to the folder specified with the -f option. (SoapUI Pro only)
F : Sets the format of the report specified with the -R option, for Printable reports this is one of PDF, XLS, HTML, RTF, CSV, TXT, and XML. For Data Export this is either XML or CSV (SoapUI Pro only)
g : Sets the output to include Coverage HTML reports ( SoapUI Pro only )
E : Sets which environment to use (SoapUI Pro only)

官方参数说明: http://www.soapui.org/Test-Automation/functional-tests.html

posted @ 2015-06-30 17:57  蚂蚁搬家H  阅读(926)  评论(0编辑  收藏  举报