相信你已经火烧眉毛的要拿 Robot Framework 写自动化测试项目了,先别着急! 当你要使用 Python 去开发一个网站的时候,是否是要先从 Python 的基本语法学起? Builtin 库是 Robot Framework 自带的基础库,提供了一套基础的关键字。本节介绍的大多关键字都由该库提供。编程
log 就是 “print”
log 关键字就是编程语言里的 “print” 同样,能够打印任何你想打印的内容。bash
*** Test Cases ***
test case1 log robot framework log python
定义变量
在 Robot Framework 中经过 “Set variable” 关键字来定义变量,如:编程语言
*** Test Cases ***
test case2 ${a} Set variable python log ${a}
链接对象
“Catenate”关键字能够链接多个对象post
*** Test Cases ***
test case3 ${hi} Catenate hello world log ${hi}
加上 “SEPARATOR=” 能够对多个链接的信息进行分割。测试
*** Test Cases ***
test case4 ${hi} Catenate SEPARATOR=--- hello world log ${hi}
定义列表
若是经过 “@{}” 去定义列表的话,能够经过 “log many” 关键字进行打印网站
*** Test Cases ***
test case5 @{abc} Create List a b c log many @{abc}
时间操做
在 Robot Framework 中也提供操做时间的关键字。ui
一、 “get time” 关键字用来获取当前时间。spa
*** Test Cases ***
test case6 ${t} get time log ${t}
二、 “sleep”关键字用来设置休眠必定时间code
*** Test Cases ***
test case7
${t} get time sleep 5 ${t} get time