如何在匹配xpath count = 0和大于0时使用if和else条件

时间:2015-07-16 12:31:32

标签: xpath robotframework

${result}=    Run keyword and ignore error    Get Matching Xpath Count xpath=${node A}

Run keyword if    '${result[0]}' == '0'   
click element    ${node A}

ELSE

click element    ${node B}

在这里怎么说其他条件

1 个答案:

答案 0 :(得分:0)

${result}=    Run keyword and ignore error    Get Matching Xpath Count xpath=${node A}
Run keyword if    '${result[0]}' == '0'
...    click element    ${node A}
...    ELSE
...    click element    ${node B}

以上是否有效?如果没有,请提供更多信息