robotframework 如果方法 returns true

robotframework if method returns true

在我的测试中,我有很多依赖于相同函数的条件部分'get max duration passed' python 方法 returns True or False 例如

  FOR    ${i}    IN RANGE    9999999
    ${max_passed}  get max duration passed
    Exit For Loop If    ${max_passed}

我有很多地方,例如'run keyword if' 我首先将 'get max duration passed' 的结果放入一个变量中,然后使用该变量。

有没有办法直接使用方法? 喜欢:

  FOR    ${i}    IN RANGE    9999999
    Exit For Loop If    get max duration passed

使用 robotframework 3.1.1

答案是否定的

因为“Exit For Loop If”需要一个可以计算的布尔条件,而不是在您的情况下 returns 布尔值的关键字或方法。