您的位置:首页 > 其它

Robotframework -- Run Keyword关键字

2017-07-17 19:32 141 查看

Robotframework – Run Keyword关键字

Run Keyword

Run Keywords

Run Keyword If:

runs the given keyword with the given arguments, if ‘condition’ is true.

另外, 该关键字还可以与ELSE,ELSE IF 一起使用,用于选择分支结构.

Run Keyword Unless:

runs the given keyword with the given arguments, if ‘condition’ is false.

Run Keyword And Ignore Error

Run Keyword And Continue On Failure

Run Keyword And Expect Error

Repeat Keyword

Wait Until Keyword Succeeds

举例

*** Test Cases ***
case1
${var}    Set Variable    log
Run Keyword    ${var}    abc
Run Keywords    ${var}    abc
...    AND    ${var}    EFG
Run Keyword If    '${var}'=='log'    ${var}    iflog
Run Keyword Unless    '${var}'=='test'    ${var}    unless
Run Keyword And Ignore Error    Fail    ignore
${status}    Run Keyword And Return Status    Log    selenium
Run Keyword And Continue On Failure    Fail
Run Keyword And Expect Error    *    Fail
Repeat Keyword    2    Log    repeat
Wait Until Keyword Succeeds    30s    5s    Log    aaa
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息