0

In the robot framework, I want to continue For Loop even if any keyword fails inside the Loop. For example, I have the code as shown below:

FOR    ${member}    IN    @{all data members}
      Keyword 1   ${member}
      Keyword 2   ${member}
      ..............
      Keyword n   ${member}
END

If any keyword (e.g. Keyword 2) fails, the FOR loop execution should continue.

1 Answer 1

3

You could use keyword Run Keyword And Continue On Failure before each keyword or use keyword Run Keyword And Return Status and manually handle errors.

Sign up to request clarification or add additional context in comments.

3 Comments

It seems that we do not have try...catch like thing that could be used inside the for loop in robot framework. Can we customize the keyword "Run Keyword And Continue On Failure" as "Run Keyword And Continue On Failure With Failure Status" so that it can also return status(true, false) along with showing failure exceptions.
You could try to use keyword Run Keyword And Ignore Error. It returns strings PASS or FAIL and return value or error that happened robotframework.org/robotframework/latest/libraries/…
Thank you so much. It seems it can solve my problem to some extent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.