执行命令

  • 执行一个用例

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

转自: https://blog.51cto.com/7717647/2089045

robot用例执行常用命令(还没试)的更多相关文章

  1. robot用例执行常用命令(转)

    执行命令 执行一个用例 robot -t “testcase_name“ data_test.robot 按用例文件执行 robot data_test.robot或者 robot --suite “ ...

  2. robot用例执行常用命令

    执行命令 执行一个用例 robot -t “testcase_name“ data_test.robot 按用例文件执行 robot data_test.robot或者 robot --suite “ ...

  3. jmeter no-JUI执行常用命令(四)

    一.常用命令简述 -n, --nongui命令行界面启动jmeter-t, --testfile {filename}jmx结尾的测试计划,支持相对路径-l, --logfile {filename} ...

  4. appium+python自动化42-微信公众号 (可能以后会遇到也遇到切换不了webview的问题 记录再此 还没试)

    前言 本篇介绍如何在微信公众号上自动化测试,以操作我的个人公众号:yoyoketang为例,没关注的,先微信关注了,再跟着操作 环境准备:python 3.6appium 1.7以上版本微信6.6.6 ...

  5. Web自动化遇到shadowDOM节点操作(还没试)

    近期有同学在做web自动化的时候,发现页面上有些元素,在selenium中无法通过xpath来定位,各种原因找了半天,都没找到解决方案. 最后发现元素在一个叫做shadow-root的节点下面. 如下 ...

  6. python读写csv文件的方法(还没试,先记录一下)

    该csv模块定义了以下功能: csv.reader(csvfile,dialect ='excel',** fmtparams ) 返回一个reader对象,它将迭代给定csvfile中的行. csv ...

  7. Locust-参数化批量注册(还没试,目测试可以的)

    前言 实现场景:所有并发虚拟用户共享同一份测试数据,并且保证虚拟用户使用的数据不重复.例如,模拟10用户并发注册账号,总共有100个手机号,要求注册账号不重复,注册完毕后结束测试 准备数据 虚拟用户 ...

  8. 解决Jmeter跨线程组取参数值难题!(还没试)

    来源 https://mp.weixin.qq.com/s/q7ArxwnX1sOfa9tfHouSBQ 如果你工作中已经在用jmeter做接口测试,或性能测试了,你可能会遇到一个麻烦.   那就是j ...

  9. jmeter 调用python的方法三种 (还没试)

    参考文章1: Jmeter 运行 Python 代码进行 AK/SK 认证 (使用 OS Process Sampler) 思路是:jmeter调用shell,用shell执行py 参考文章2: Jm ...

随机推荐

  1. Educational Codeforces Round 41 (Rated for Div. 2) D. Pair Of Lines (几何,随机)

    D. Pair Of Lines time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...

  2. vue 关于vuex

    <!-- vuex 配置js store.js -->1.引入vue和vuex import Vue from 'vue'import Vuex from 'vuex'Vue.use(Vu ...

  3. Visual Studio 快捷键、常见问题

    前言 由于平时自己在使用 VS 过程中遇到过一些很常见的问题,比如基本的设置.工具等.VS 十分的强大(宇宙第一 IDE),所以有些功能藏的深也不好找,就在这里记录下. 正文 一.快捷操作 1.调试. ...

  4. 大数据之路week06--day07(Linux中的mysql的离线安装)

    这里我提供 服务端和客户端的两个jar包的百度云,也是我使用的 链接:https://pan.baidu.com/s/11a3LT-ENZ8n9IF19-VjmWA 提取码:bdls 离线安装Mysq ...

  5. [ Educational Codeforces Round 65 (Rated for Div. 2)][二分]

    https://codeforc.es/contest/1167/problem/E E. Range Deleting time limit per test 2 seconds memory li ...

  6. nginx location中root指令和alias指令的区别

    nginx location中root指令和alias指令 功能:将url映射为文件路径,以返回静态文件内容 差别:root会将完整的url映射进文件路径中 alias只会将location后的url ...

  7. 43、扩展原理-@EventListener与SmartInitializingSingleton

    43.扩展原理-@EventListener与SmartInitializingSingleton 还可以使用 @EventListener; 来监听事件 原理:使用EventListenerMeth ...

  8. learning scala stripMargin

    (1)Scala中创建多行字符串使用Scala的Multiline String. 在Scala中,利用三个双引号包围多行字符串就可以实现. 代码实例如: val foo = "" ...

  9. jquery 元素前或插入一元素

    /* *插入方法 */function addEditRow(obj, modelId) { $($("#" + modelId).html()).insertAfter($(ob ...

  10. 怎么样修改小程序分享的title/onShareAppMessage

    onShareAppMessage: function (res) { if (res.from === 'button') { // 来自页面内转发按钮 console.log(res.target ...