【问题标题】:how to use Run Keyword If with 2 conditions in Robot Framework?如何在 Robot Framework 中使用带有 2 个条件的 Run Keyword If?
【发布时间】:2016-08-16 10:35:00
【问题描述】:

您好,我在builtin library 中使用Run Keyword If,如果满足两个条件,我想运行一个关键字。 在一个条件下,我这样做是这样的:

Scale Down Service Should Succeed
Get Services
:For    ${Service}      IN              @{BODY.json()}
    \   Run Keyword If      ${Service['DOWN']}     Scale Down Service With Correct ID And Can be Scaled Down   ${Service['ID']}     ${Service['ContainersRunning']}

现在我的问题是如何使用 2 个条件来执行此操作,例如 ${Service['DOWN']}(布尔类型)和 ${Service['Name']}="service"

【问题讨论】:

    标签: robotframework


    【解决方案1】:

    您可以使用“AND”运算符来验证以下两个条件:

    Run Keyword If      ${Service['DOWN']} and ${Service['Name']}=="service"     Scale Down Service With Correct ID And Can be Scaled Down   ${Service['ID']}     ${Service['ContainersRunning']}
    

    【讨论】:

      猜你喜欢
      • 2017-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-14
      • 2018-04-12
      • 2020-12-24
      • 1970-01-01
      相关资源
      最近更新 更多