zoukankan      html  css  js  c++  java
  • soapUI系列之—-06 testrunner实现自动化测试

    TestRunner为soapUI自带------testrunner.bat/testrunner.sh

    实现步骤:

    1. 使用soapUI,针对接口文件创建测试用例。

    2. 将测试用例保存至本地, 用例将以XML文件格式保存。

    3. 运行testrunner工具

    3.1 在Windows下运行

    在本地建立bat文件调用soapUI的bin目录下的testrunner.bat工具去执行测试用例。


    bat文件内容如下:

    @Echo Off
    
    cd
    
    c:
    
    cd C:ProgramFilesSmartBearReadyAPI-1.2.2in
    
    testrunner.bat -r -jC:WorkInterFaceProjectsChinaTVprogramWebService-soapui-project.xml -fC:Work
    eports -FPDF

    C:Program FilesSmartBearReadyAPI-1.2.2in:soapUI安装目录。
    C:WorkInterFaceProjectsChinaTVprogramWebService-soapui-project.xml:测试用例。
    C:Work eports:测试报告输出路径。

    【注意】有时候运行并不会成功,这是因为少一个soapui的全局配置文件,默认soapui-settings.xml位置为C:Usersceshi

    【解决办法】将soapui-settings.xml复制到c盘根目录下;倘若还有错误则使用-t参数指定 -t C:soapui-settings.xml

    3.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文件带上

    4. bat文件详解

    soapUI提供了一个命令行工具testrunner.bat来运行一个项目中的TestSuit,可以在<soap_ui_home>/bin下找到它
    它的使用非常简单,只需要设置下面的几个常用参数即可:
    -s 指定要运行的 TestSuite
    -f 指定运行结果的输出目录
    -j 生成 junit 风格的 report
    -r 运行完成以后打印一个简单的 summary

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


  • 相关阅读:
    【2021-04-15】台上一分钟,背后十年功
    【2021-04-14】买了人生中的第一个车位
    计算机网络实验部分
    乘积最大子数组
    计算各个位数不同的数字个数
    周总结
    最长回文子序列
    最长回文串
    回文子串
    拼图
  • 原文地址:https://www.cnblogs.com/liuyitan/p/7911071.html
Copyright © 2011-2022 走看看