你好,游客 登录 注册 搜索
背景:
阅读新闻

SoapUI命令行方式运行

[日期:2016-08-03] 来源:Linux社区  作者:hunterno4 [字体: ]

SoapUI支持用命令行方式运行测试用例并生成测试报告,因此使用SoapUI可以很好地进行接口测试自动化测试以及持续集成。

首先查看testrunner.sh脚本支持哪些选项

直接执行testrunner.sh将给出帮助手册:
soapUI Pro 4.5.2 TestCase Runner
usage: testrunner [options] <soapui-project-file>
-F    Report format. Used with -R. Valid options PDF, XLS, HTML, RTF,
      CSV, TXT, and XML (comma-separated)
-v    Sets password for soapui-settings.xml file
-t    Sets the soapui-settings.xml file to use
-A    Turns on exporting of all results using folders instead of long
      filenames
-D    Sets system property with name=value
-E    Sets the environment
-G    Sets global property with name=value
-I    Do not stop if error occurs, ignore them
-M    Creates a Test Run Log Report in XML format
-P    Sets or overrides project property with name=value
-R    Report to Generate
-S    Saves the project after running the tests
-a    Turns on exporting of all results
-c    Sets the testcase
-d    Sets the domain
-e    Sets the endpoint
-f    Sets the output folder to export results to
-g    Sets the output to include Coverage HTML reports
-h    Sets the host
-i    Enables Swing UI for scripts
-j    Sets the output to include JUnit XML reports
-m    Sets the maximum number of TestStep errors to save for each
      testcase
-o    Opens generated report(s) in a browser
-p    Sets the password
-r    Prints a small summary report
-s    Sets the testsuite
-u    Sets the username
-w    Sets the WSS password type, either 'Text' or 'Digest'
-x    Sets project password for decryption if project is encrypted
命令行格式:testrunner [选项] soapui工程的xml文件
主要命令选项说明:
-D    设置system property,即可以设置SoapUI——Help——System properties菜单下的属性值
        例如命令行指定-Dfile.encoding=UTF-8
-I    设置为用例执行中出现错误时不停止,继续执行
-a    默认SoapUI只会在用例执行时有错时(如断言有错),才会生成.txt的包含请求、响应的详细日志信息,便于查看当时请求出          错的详细情况,若加上-a选项,则不论出错与否都将生成该报告文件。
-f      设置报告输出的路径,不指定则默认为输出到当前目录下
-j    生成JUnit格式的XML报告文件
-r    打印简略的总结报告
-s    指定要执行的用例集名称

因此命令行执行SoapUI用例可以如下:
sh testrunner.sh -Dfile.encoding=UTF-8 -I -s $testsuit -r -j -f $REPORTS_PATH $TESTSUIT_PATH/soapui_example.xml

执行完成后将生成JUnit格式的xml报告文件,可在Jenkins中生成测试报告及接口响应性能趋势图等
出错时生成的.txt格式的包含详细请求参数及响应数据的日志报告文件可以邮件附件形式发送,进行及时反馈及出错时问题定位

在Linux/Unix上安装开源测试工具SoapUI  http://www.linuxidc.com/Linux/2016-03/128857.htm

SoapUI 的详细介绍请点这里
SoapUI 的下载地址请点这里

本文永久更新链接地址http://www.linuxidc.com/Linux/2016-08/133890.htm

linux
相关资讯       soapUI 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款