随笔分类 - RF
摘要:搭建步骤: 1、python环境 省略 2、安装robotframework pip命令:pip install robotframework 3、JDK1.8 + Eclipse安装 + RED插件 官方发布的每一个RED插件,都会有相应支持的Eclipe版本说明。( jdk的安装跳过,网上百度就
阅读全文
摘要:常用关键字: should be true python表达式 1 ${res} set variable he 2 should be true '${res}' in 'hello' # 不加‘’号,代表变量 3 # python表达式,空格不能多于2个,$res只能应用在表达式中 4 shou
阅读全文
摘要:用户关键字 RF中像 编程语言中函数 概念的东西,就是用户关键字,用户关键字就像RF中的函数 用户关键字大小写不敏感 Keywords表就是定义用户关键字的= 参数和返回值 资源文件 资源文件其实就是 RF 层面的库文件。 里面可以包含用来共享的 用户关键字。也可以包含 Variable 表 定义
阅读全文
摘要:条件判断 run keyword if condition name *args ... ELSE IF conditon name *args ...ELSE name *args condition:python表达式,条件表达式参数 传给python中的eval()函数 name:条件满足时执
阅读全文
摘要:用例执行 Robot Framework 的命令格式如下: robot [options] data_sources options 是 RF命令的选项, 可以为空 常用options : --pythonpath(-P) 指定python模块搜索路径 --name 指定本次测试名称 --test(
阅读全文
摘要:共享变量(Variables) 1、变量表: 导入模式: 1、套件文件,不需要导入 2、资源文件 Resource xxx.robot 2、变量文件 导入模式: 1、Variables xx.py 测试库 1、模块-函数: 1、路径法:相对路径与绝对路径 使用/分隔符 后面加.py 2、模块法 2、
阅读全文
摘要:1 *** Settings *** 2 Library Collections 3 *** Test Cases *** 4 list 5 ${list1} create list a b c 6 ${list2} create list 1 2 3 7 append to list ${list
阅读全文
摘要:setup:是测试一个用例(或者套件)前要做的事情 teardown:是测试后要做的事情 在RF中,每个测试套件目录、测试套件文件、测试用例 都可以有自己的setup 和teardown 所有的 setup 和teardown 操作都 只能由一个关键字语句 构成 1、测试用例中的setup与tear
阅读全文