如何在 Robot Framework 中使用 运行 关键字 If 和 2 个条件?

how to use Run Keyword If with 2 conditions in Robot Framework?

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

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"

您可以使用 "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']}