zoukankan      html  css  js  c++  java
  • robot用例执行常用命令

    执行命令

    执行一个用例

    robot -t “testcase_name“ data_test.robot

    按用例文件执行

    robot data_test.robot
    或者 robot --suite “prjxx.robot.data test" test_directory

    执行目录下所有用例

    robot test_directory
    或者python -m robot test_directory

    按执行tag执行用例

    robot --include smoke test_directory
    robot --include smoke path/test_file.robot

    剔除用例执行

    robot --exclude smoke test_directory
    或者
    robot --exclude smoke path/test_file.robot

    乱序跑

    可以有效避免testcase之间的依赖,保持独立性是testcase持续有效的关键
    robot --randomize tests path/test_file.robot

    变量参数

    可以更新多个变量,达到每次跑不一样内容的目的,例如可以通过命令切换环境,切换数据等
    robot --variable ENV:uat --variable TEST_DATA:uat regression.robot

    结果报告

    生成执行报告

    默认生成到当前目录,会包含output.xml、log.html、report.html
    可以对其分别修改,参数如下:
    --outputdir (-d)
    --output output.xml 
    --report report.html
    --log log.html

    不想要某个报告可以设置None,例如:

    --output NONE --report NONE --log NONE

    结果定位

    不同的执行结果会有不同的结果代码(RC),用于快速定位问题

    RC  Explanation
    0   全部通过
    1-249   出现250个内的错误用例
    250 出现250个内的错误用例
    251 帮助信息打印
    252 异常测试数据
    253 用户中断了执行
    255 无法识别的异常

    合并结果文件

    rebot -N new_report.html -o new_output.xml 1st_output.xml 2nd_output.xml

    合并目录下所有的结果

    python -m robot.rebot --name Combined outputs/*.xml

    抽取整合测试结果

    rebot --log smoke_log.html --report smoke_report.html --include smoke
    --ReportTitle Smoke_Tests --ReportBackground green:yellow:red
    --TagStatCombine tag1ANDtag2 path/to/myoutput.xml

    资料生成

    输出当前框架的lib库说明文档

    python -m robot.libdoc OperatingSystem OperatingSystem.html

    生成用例文档

    python -m robot.testdoc xxx_prj1.robot/*.robot testcasedoc.html

  • 相关阅读:
    Java8 Stream Function
    PLINQ (C#/.Net 4.5.1) vs Stream (JDK/Java 8) Performance
    罗素 尊重 《事实》
    小品 《研发的一天》
    Java8 λ表达式 stream group by max then Option then PlainObject
    这人好像一条狗啊。什么是共识?
    TOGAF TheOpenGroup引领开发厂商中立的开放技术标准和认证
    OpenMP vs. MPI
    BPMN2 online draw tools 在线作图工具
    DecisionCamp 2019, Decision Manager, AI, and the Future
  • 原文地址:https://www.cnblogs.com/blogofzxf/p/10470729.html
Copyright © 2011-2022 走看看