标签:settings port create bre drag response abc bcd and
run keyword if ‘2019’ in $html and ‘UTC‘ in $html
... log to console \n 2019年的,UTC时间
*** Test Cases *** 测试1 ${html} getwebinfo #判断html是否包含对应信息 run keyword if ‘2020‘ in $html log to console 今年是2020年
run keyword if ‘2019‘ in $html and ‘UTC‘ in $html ... log to console \n2019年的,UTC时间 ... ELSE log to console \n不是2019年的时间
ELSE IF 参数
run keyword if ‘2019‘ in $html and ‘UTC‘ in $html ... log to console \n 2019年的,UTC时间 ... ELSE IF ‘2019‘ in $html log to console \n2019年的 ... ELSE IF ‘UTC‘ in $html log to console \nUTC时间 ... ELSE log to console \n以上都不是
*** Test Cases *** 测试1 FOR ${i} IN RANGE 9999 ${weigt} get value from user 请输入你的体重 run keyword if $weight==‘cont‘ continue for loop run keyword if $weight==‘break‘ exit for loop log to console 体重${weight} run keyword if int($weight) >60 log to console 超重了要减肥 END ##简写 *** Test Cases *** 测试1 FOR ${i} IN RANGE 9999 ${weigt} get value from user 请输入你的体重 continue for loop if $weight==‘cont‘ exit for loop if $weight==‘break‘ log to console 体重${weight} run keyword if int($weight) >60 log to console 超重了要减肥 END
官方文档介绍:collection是用来处理robotframework列表和字典的库
*** Settings *** Library Collections *** Test Cases *** 测试1 ${list}= create list a b c Append To List ${list} hello #增加 remove from list ${list} 0 #删除 set List Value ${list} 0 he #替换 log to console ${list}
官方文档介绍:Evaluate是执行python表达式,并返回执行结果
完全可以写成
${var}= evaluate 890
${var}= evaluate [‘hello‘]*10
由python文件函数,使用RF导入
05:robotframework条件判断、初始化清除与evaluate
标签:settings port create bre drag response abc bcd and
原文地址:https://www.cnblogs.com/kelly11/p/12696048.html