我想通过使用 else if 从关键字获取值。
例子:
String text = ""
If variable > 5
text = "one";
else if variable <5
text = "two";
else
text = "three";
在机器人框架中
我用代码
${txt} Set Variable
${txt}= Run Keyword If ${length} > 5 Some Keyword
\ ELSE IF ${length} < 5 Some Keyword
\ ELSE Some Keyword
Log ${txt}
错误!!!
In Keyword ELSE IF ; Keyword name cannot be empty
最佳答案
只需在 ELSE IF 关键字前的第一个单元格中添加三个点 (...)
${txt} Set Variable
${txt}= Run Keyword If ${lenght} > 5 Some Keyword
... ELSE IF ${lenght} < 5 Some Keyword
... ELSE Some Keyword
Log ${txt}
关于python-2.7 - 机器人框架中的 If Else-if,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28229676/