15.32. Run Keyword
Name:
Run Keyword
Source:
运行指定的关键字name
Arguments:
[ name | *args ]
Name为要运行的关键字的名称
Args为该关键字name的参数列表
例如:关键字名称也可放在变量中
${log_name} set variable log
run keyword ${log_name} 我就是log的内容呀
run keyword log 就是我呀log
15.33. Run Keyword If
Name:
Run Keyword If
Source:
满足指定的条件Condition,就执行指定的关键字name
Arguments:
[ condition | name | *args ]
Condition 条件表达式
Name要指定的关键字的名称
Args关键字name的参数,关键字不同,参数就不同
例如:
${log_name} set variable log
run keyword ${log_name} 我就是log的内容呀
${com_name} set variable comment
run keyword if 2>4 ${log_name} 我是日志的if语句
… ELSE ${com_name} 我是comment
15.34. Run Keyword Unless
Name:
Run Keyword Unless
Source:
不满足指定的条件,即condition为False时,执行关键字name
Arguments:
[ condition | name | *args ]
Condition 条件表达式,返回bool
Name 要执行的关键字
Args 为name关键字的参数
例如:
${log_name} set variable log
${com_name} set variable comment
run keyword unless 1>4 ${log_name} 不满足条件就执行1>4
run keyword unless 5>4 ${log_name} 我是日志的if语句5>4
15.35. Run Keywords
Name:
Run Keywords
Source:
执行指定的多个关键字,参数是关键字列表,猜测这些关键字应该没有参数,无法传参
Arguments:
[ * keywords]
Keywords 要执行的关键字列表,也可以存储在关键字名称的list中
例如:1、如下是我自己写的两个接口
2、导入到RIDE中
*** Settings ***
Library Selenium2Library
Library …/…/…/氚云_python/my_method.py
3、测试用例中,可以直接使用这两个关键字
测试用例
${lo