【发布时间】:2021-12-17 21:18:26
【问题描述】:
在 RobotFramework 4 中,我们现在可以编写更传统的 if/else 语句。
比如:
*** Keywords ***
Do conditional execution
IF ${CONDITION}
Log True!
ELSE IF "cat" == "dog"
Log Dog!
ELSE
Log Not True!
END
有谁知道如何在多个条件下编写它?我目前正在做某事。如果我像这样写多个语句,它可以工作
IF "${error1}" == "False"
Do Something
ELSE IF "${error2}" == "False"
Do Something
ELSE IF "${error3}" == "False"
Do Something
但如果我尝试这样写
IF "${error1}" == "False" or "${error2}" == "False" or "${error3}" == "False"
Write To Google Document
然后它告诉我
IF has more than one condition.
如果我写错了有什么想法吗?还是有更好的办法?
【问题讨论】:
标签: python selenium testing robotframework qa