RF-template使用
在测试案例中,可以使用template设置进行数据驱动的测试,template设置方法:
在设置项中填写模板的关键字名称,测试案例本身只能包含template关键字使用的数据;
*** Settings ***
Resource 操作层.txt
Resource 流程层.txt
*** Test Cases ***
case1
[Setup] 初始化
[Template] 比较两个数是否相等
1 2
3 3
5 4
[Teardown] 垃圾回收
*** Keywords ***
初始化
log 测试前数据初始化完毕
垃圾回收
log 测试完成后垃圾回收完毕
执行超时
log 测试执行超时啦
比较两个数是否相等
[Arguments] ${v1} ${v2}
should be equal ${v1} ${v2}
执行结果:
Starting test: Project2.套件层.case1
20170521 17:44:17.072 : INFO : 测试前数据初始化完毕
20170521 17:44:17.072 : INFO :
Argument types are:
<type 'unicode'>
<type 'unicode'>
20170521 17:44:17.088 : FAIL : 1 != 2
20170521 17:44:17.088 : INFO :
Argument types are:
<type 'unicode'>
<type 'unicode'>
20170521 17:44:17.088 : INFO :
Argument types are:
<type 'unicode'>
<type 'unicode'>
20170521 17:44:17.088 : FAIL : 5 != 4
20170521 17:44:17.088 : INFO : 测试完成后垃圾回收完毕
Ending test: Project2.套件层.case1
相关文章
- [WASM] Create a New Rust/Webpack Project using the rust-webpack Template
- [Angular Directive] Create a Template Storage Service in Angular 2
- 玩转Eclipse — 自动代码生成的Java Code Template
- [HTML 5] Inserting DOM as String template insertAdjacentHTML
- Ansible详解(十一)——Ansible Template高级控制
- Ansible详解(十)——Ansible Template模板基础
- CM: webservice 元数据在word template中的存储
- CM: word template web service schema number的限制
- SAP Fiori element框架template的框架加载逻辑
- ng-template 使用过程中参数传递错误的单步调试
- 004-行为型-02-模板方法模式(Template Method)
- HDU 5045(Contest-费用流)[template:费用流]
- python里使用string.Template实现自定义转义字符和正则表达式替换
- Item1——理解模板类型推导(Understand template type deduction)
- Flask 的完全使用教程(文件上传下载,cookie,session,template使用)