robotframework - User key 操作
一、用户关键字操作思路
a、创建model1资源
b、在model下创建用户关键字 - 循环
c、测试套件下创建test_case/case2 & 用户关键字
d、测试套件中导入Resource 的 model1 资源
二、对应的操作如下:
1、右键单击创建资源 -- 自定义输入name -- 小编的为 model1
2、在model上右键单击创建 user key -- 小编定义的关键字为 add & myrange
3、 用户关键字 add 运算,使用到 Evaluate 关键字
4、用户关键字 myrange 范围
5、新建测试套件-User key--- 在User key 下创建Test case & User Keyword
6、在 User key 测试套件中导入model 资源
7、test_case & cese2 实例截图:
8、test_case & case2 脚本如下:
*** Settings ***
Resource model.robot
*** Test Cases ***
test_case
myrange 5
${c} add 5 3
log ${c}
test_case2
[Setup] start
log this is test case
[Teardown] end
*** Keywords ***
start
log start test case
end
log end test case
9、test_case & case2 用例执行结果:
Starting test: Rf Test Pro.User Key.test_case
20190622 23:17:33.670 : INFO : 0
20190622 23:17:33.672 : INFO : 1
20190622 23:17:33.674 : INFO : 2
20190622 23:17:33.676 : INFO : 3
20190622 23:17:33.677 : INFO : 4
20190622 23:17:33.680 : INFO : ${c} = 8
20190622 23:17:33.681 : INFO : ${c} = 8
20190622 23:17:33.682 : INFO : 8
Ending test: Rf Test Pro.User Key.test_case
Starting test: Rf Test Pro.User Key.test_case2
20190622 23:17:33.685 : INFO : start test case
20190622 23:17:33.687 : INFO : this is test case
20190622 23:17:33.689 : INFO : end test case
Ending test: Rf Test Pro.User Key.test_case2
最新文章
- ReactJs 报错 Element type is invalid: expected a string (from built-in components) or a class/function (for composite components) but got: undefined. Check the render method of `Me`.
- CentOS7安装docker
- JS中数组的操作[转]
- oracle rac重建控制文件
- C/C++中的指针数组和数组指针
- python学习之路-day5-模块
- less 快捷操作
- C# 将cookiecontainer写到本地
- C++中#include的工作原理
- VxWorks6.6 pcPentium BSP 使用说明(二):创建启动盘
- 《阿里巴巴Java开发手册(正式版》读记
- WebJars
- spring(AOP)静态代理
- bzoj4520【CQOI2016】K远点对
- java注解的简单介绍
- ol3开发离线地图
- R中的空间数据分析
- level 1 -- unit 2 - what 引导的特殊疑问句
- vue性能优化1--懒加载
- WPF样式动画Trigger.EnterActions和Trigger.ExitActions(ExitActions其实可以不做任何事情)
热门文章
- Spring框架中 配置c3p0连接池
- 九度oj 题目1190:大整数排序
- 洛谷—— P2543 [AHOI2004]奇怪的字符串
- mysql性能调优——Query优化
- 洛谷 P2064 奇妙的汽车
- Ubuntu 16.04设置rc.local开机启动命令/脚本的方法(通过update-rc.d管理Ubuntu开机启动程序/服务)
- Eclipse编辑YAML插件-YEdit
- delphi异步选择模型编程TCP
- VC++ 提示无法打开包括文件“iostream.h”怎么办
- 如何在其他js 引入main.js 中 vue 的实例?