Sven van den Boogaart
Sven van den Boogaart

Reputation: 12317

robotframework if method returns true

In my test I have a lot of conditional parts that are depended on the same function 'get max duration passed' It is a python method that returns True or False E.g.

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

I have a lot of places where I have e.g. 'run keyword if' where I first put the outcome of 'get max duration passed' inside a variable and than use the variable.

Is there a way to use the method directly? like:

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

Using robotframework 3.1.1

Upvotes: 0

Views: 347

Answers (1)

chesthar
chesthar

Reputation: 102

The answer is no.

Because "Exit For Loop If" requires a boolean condition which can be evaluated and not a keyword or a method which returns boolean in your case.

Upvotes: 2

Related Questions