Search code examples
robotframework

Storing a Boolean from a Keyword


I have a task where my Keyword returns True or False. When I run this .robot-script it halts the test if the Keyword is False, telling me the test |FAIL|. I dont want it to halt. I want it to store the Boolean in a variable so I can use that boolean in a IF-statement

*** Task ***
${BooleanValue} = Keyword

IF ${BooleanValue} == False
 etc etc

Solution

  • Use Run Keyword And Return Status:

    ${BooleanValue} =    Run Keyword And Return Status   Keyword