当前位置:网站首页>RobotFramework 之 用例执行
RobotFramework 之 用例执行
2022-04-23 14:03:00 【沉觞流年】
RobotFramework 之 用例执行
RF的命令格式
robot [options] data_sources
- options 是 RF命令的选项,可以为空
- data_sources 则是 要执行的测试套件文件或者目录的路径。
可以是绝对路径,也可以是相对路径,相当于当前 shell 的工作目录
执行测试套件文件、套件目录
执行测试套件文件
如果执行的是测试套件文件,则执行该文件中所有的测试用例
robot test1.robot
以相对路径方式,执行test1.robot文件中所有的测试用例
robot E:/RFstudy/test1.robot
以绝对路径方式,执行test1.robot文件中所有的测试用例
如果需要执行指定的过个测试套件文件,指定执行的多个套件文件名称即可
robot test1.robot test2.robot test3.robot
这种方式执行测试套件文件,生成的测试报告和日志文件的标题名称通过&
关联,Test1 & Test2 & Test3 Report
执行测试套件目录
如果指定的是测试套件目录,则递归执行该目录下包含的所有子目录里面所有测试套件文件里面的用例
robot Test
执行 Test文件夹 中所有的robot文件中的测试用例(test1.robot和test2.robot均执行),这里的路径通常是以相对路径方式,且一般测试套件目录都是在项目根目录下
如果需要执行指定的过个测试套件目录,指定执行的多个套件文件夹名称即可
robot T1 T2 T3
这种方式执行测试套件文件,生成的测试报告和日志文件的标题名称会通过&
关联:T1 & Tt2 & T3 Report
执行测试套件文件和套件目录
robot test1.robot T1 T2
执行test1.robot、T1和T2里所有的测试用例
拓展: 如果嫌弃测试报告和日志文件的标题名称太啰嗦,或者不美观,可以通过--name
参数指定测试报告名称
robot --name 回归测试 T1 T2 T3
测试报告和日志文件的标题名称就变成了回归测试
常用命令参数
- 运行指定的用例:
-t 或 --test <name>
- 运行指定的用例套件:
-s 或 --suite <name>
- 运行指定标签的用例:
-i 或 --include <tag>
- 运行除指定标签以外的用例:
-e 或 --exclude <tag>
- 指定文件输出的目录:
-d 或 --outputdir <dir>
- 指定文件输出的文件名(xml文件):
-o 或 --output <file>
- 设置重新运行失败的用例:
-R 或 --rerunfailed <outputxml_file>
- 设置重新运行失败的用例套件:
-S 或 --rerunfailedsuites <outputxml_file>
- 设置运行时的变量:
-v 或 --variable <name:value>
- 设置运行时变量(从文件读取):
-V 或 --variablefile <path:args>
根据执行参数筛选用例
命令与通配符结合使用
RF命令的参数还可以与通配符结合使用
1、执行所有以test开头的所有测试套件文件里,所有用例名称以case开头的用例,并命名测试结果文件标题为 回归测试
robot --name 回归测试 -t case* test*.robot
或 robot --name 回归测试 --test case* test*.robot
2、执行所有以T开头的测试套件目录和以test开头的测试套件文件,并命名测试结果文件标题为 冒烟测试
robot --name 冒烟测试 -s T* test*.robot
或 robot --name 冒烟测试 --suit T* test*.robot
通过执行文件执行命令
如果命令太长,可以将命令放到一个txt文件中,然后通过命令robot -A 文件名
执行文件中的命令
args.txt
--name 冒烟测试
-s T*
test*.robot
注意,参数之间要换行
版权声明
本文为[沉觞流年]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_44614026/article/details/115610408
边栏推荐
- Interesting talk about network protocol
- Quartus prime hardware experimental development (de2-115 board) experiment 1 CPU instruction calculator design
- As a junior college student, I studied hard in closed doors for 56 days, won Ali offer with tears, five rounds of interviews and six hours of soul torture
- Quartus Prime硬件实验开发(DE2-115板)实验二功能可调综合计时器设计
- 室内外地图切换(室内基于ibeacons三点定位)
- json反序列化匿名数组/对象
- Crontab timing task output generates a large number of mail and runs out of file system inode problem processing
- AtomicIntegerArray源码分析与感悟
- Nodejs安装及环境配置
- STM32学习记录0007——新建工程(基于寄存器版)
猜你喜欢
crontab定时任务输出产生大量邮件耗尽文件系统inode问题处理
scikit-learn构建模型的万能模板
groutine
微信小程序setInterval定时函数使用详细教程
linux安装mysql后修改密码
室内外地图切换(室内基于ibeacons三点定位)
蓝绿发布、滚动发布、灰度发布,有什么区别?
烟雾传感器(mq-2)使用详细教程(基于树莓派3b+实现)
How does redis solve the problems of cache avalanche, cache breakdown and cache penetration
nodejs通过require读取本地json文件出现Unexpected token / in JSON at position
随机推荐
多线程 @Async 线程池
Android篇:2019初中级Android开发社招面试解答(中
Restful WebService和gSoap WebService的本质区别
微信小程序 input隐藏和不可操作的设置
scikit-learn构建模型的万能模板
switch使用(微信小程序)
微信小程序获取登录用户信息、openid和access_token
SQL数据库
Quartus prime hardware experimental development (de2-115 board) experiment II function adjustable comprehensive timer design
微信小程序与低功耗蓝牙通信-接受硬件端发送来的数据(四)
Jenkins construction and use
JS force deduction brush question 102 Sequence traversal of binary tree
微信小程序进行蓝牙初始化、搜索附近蓝牙设备及连接指定蓝牙(一)
go 语言 数组,字符串,切片
STM32 learning record 0007 - new project (based on register version)
websocket
Choreographer full resolution
Decimal 格式化小数位/DateTime 转换处理
smart-doc + torna生成接口文档
[VMware] address of VMware Tools