运行关键字
If '${Contains_True}' == 'true'
and
'${App_Name}' == 'App Name'
Accept_Confidential
ELSE IF '${Contains_True}' == 'true'
"Do Something" ELSE Log "Nothing"
答案 0 :(得分:2)
在下面的示例中,针对不同的组合针对使用和和/或验证来验证组合的关键字进行测试。请记住,这种和/或检查也可以是单独的ELSE IF
语句。
*** Test Cases ***
TC
[Template] Validate App and Contains
App Name true
App Name false
My app Name true
My app Name false
Not My Name true
Not My Name false
*** Keywords ***
Validate App and Contains
[Arguments] ${App_Name} ${Contains_True}
Run Keyword If
... ('${Contains_True}'=='true' and '${App_Name}'=='App Name') or '${App_Name}'=='My app Name' Return From Keyword Accept
... ELSE IF '${Contains_True}'== 'true' Log App Name is not as expected:"${App_Name}" level=WARN console=${True}
... ELSE Fail Of the combo "${App_Name}"/"${Contains_True}" None of the values are correct.