robotframework/robotframework — pull request #1817 by laurentbristiel (2014-10-07 10:14:50+00:00)
Title: Fail can fail just a keyword and be used in Wait Until Keywords Succeeds

I was looking for a "fail keyword" keyword because I thought that "fail" would terminate my test totally, whereas in fact it fails "gently" and can be caught in a wait until keyword succeeds. So I am trying to share this by putting it in the doc.

Context:
- In a test I call a "wait until keyword succeeds my_keyword_that_may_fail"
- in my_keyword_that_may_fail I compute a return value that I want to send back. But sometimes this computation does not return a proper value because my SUT is not ready. In that case I want to quit my keyword with a status=failed. Before I used to do a dummy "run keyword if ${sut_not_ready} should be equal 1 2" but a "run keyword if ${sut_not_ready} fail try_again" is nicer.