*** Settings *** Documentation RF常规使用集合 Suite Setup Suite Start Suite Teardown Suite End Library Screenshot
*** Variables *** ${start} 测试开始 ${end} 测试完毕
*** Test Cases *** test 01 [Documentation] 定义变量 [Tags] 0 ${var1} BuiltIn.Set Variable 1 log ${var1}
test 02 [Documentation] 连接参数 [Tags] 1 ${var2} catenate nice to meet you log ${var2} ${var3} catenate ${var2} 6666 log ${var3}
test 03 [Documentation] 创建列表 [Tags] 1 ${list_var} create list 赵云 刘备 关羽 张飞 log ${list_var} @{list_var} create list 赵云 刘备 关羽 张飞 #列表 log many @{list_var}
test 04 [Documentation] 时间操作 [Tags] 1 ${timeStr} get time # 获取当前时间,年-月-日 时:分:秒 ${secs} get time epoch # 获取当前时间戳 ${year} get time return year # 获取年份 ${yyyy} ${mm} ${dd} ${hh} ${mm} ${ss}= Get Time ... year,month,day,hour,min,secs # 获得年月日的分别变量值 # SLEEP 2 log 等待2秒 log ${timeStr} log ${secs} log ${year} log ${yyyy},${mm},${dd},${hh},${mm},${ss}
test 05 [Documentation] if断言 ${var5} set variable 23 Run Keyword If ${var5} <= 5 log 小于5 INFO ... ELSE IF ${var5} >= 10and ${var5} <20 log 大于等于10 INFO ... ELSE log 什么鬼 INFO
test 06 [Documentation] for循环 :FOR ${i} INRANGE 5 \ log ${i} :For ${o} INRANGE 15#指定范围 \ log ${o} :For ${p} INRANGE 152#间隔2个 \ log ${p} @{list_var} create list 12345 :For ${q} in @{list_var} \ exit for loop if ${q}==2#循环判断 \ log ${q}