Updates:
        Status: Accepted
        Labels: -Priority-Medium Priority-High Target-2.7.6

Comment #1 on issue 1266 by pekka.klarck: "Run keyword and continue on failure" changes the return value of the calling keyword to NULL
http://code.google.com/p/robotframework/issues/detail?id=1266

I agree that the current behavior is not optimal. The reason it works this way is that a keyword that fails cannot return a value, and `My Keyword` in your example actually fails. That is just a technical reason, though, and I'm sure it is possible to solve it.

I target this initially to RF 2.7.6 but I'm not sure is this easy enough to be fixed in a minor release nor is there ever going to be such a release.

Using `Run Keyword And Ignore Error` instead ought to work for you as a workaround. Instead of carrying the status around, you can make it test variable:

** Test Cases ***
Test case 1
    ${x}=    My keyword
    Log    ${x}
    Run Keyword If    "${STATUS}" == "FAIL"    Fail    ${ERROR}

*** Keywords ***
My keyword
    ${STATUS}     ${ERROR} =    Run Keyword And Expect Error    Fail
    Set Test Variable    ${STATUS}
    Set Test Variable    ${ERROR}
    ${output}=    Set Variable    Hello there
    [Return]    ${output}

Reply via email to