Reputation: 1056
I need to get the status of a check (PASS/FAIL) without changing the overall status of a test
Test 1
${passed} Run keyword And Continue On Failure Should Be Equal 1 2
Log ${passed}
${passed} Run keyword And Continue On Failure Should Be Equal 1 1
Log ${passed}
${passed} is always None
. What is the right way?
This is at the moment my working solution :(
${passed} ${value} Run keyword And Ignore Error Should Be Equal 1 2
Run Keyword If "${passed}"=="FAIL" Run keyword And Continue On Failure FAIL
Rr
Upvotes: 0
Views: 22586
Reputation: 131
This is because Run keyword And Continue On Failure does not return any value. It was never meant to.
For this purpose use Run Keyword And Return Status
This keyword returns Boolean True if the keyword that is executed succeeds and False if it fails.
${passed} = Run Keyword And Return Status Should be Equal 1 2
Run Keyword Unless ${passed} Log The previous step FAILED!
But even with just the Run keyword And Continue On Failure should have the failure of the encapsulated keyword in the log.
Upvotes: 4