Kurt Russell
Kurt Russell

Reputation: 235

How to skip an error in cucumber?

How can cucumber skip (ignore) an error without stopping the test? I mean - if an error appears -> the test must be continued.

Upvotes: 0

Views: 811

Answers (2)

Fabrice31
Fabrice31

Reputation: 760

If an error occurs during scenario, the scenario is failed. I know that sometimes, you've got complex scenario, with a lots of steps to prepare the real test, and it is frustrating that the real test is not executed at all.

The only case where I think it can be good, is when your scenario made a change and should cancel the changes after. But I prefer to deal with that on the steps to initialize the next scenario.

(As you d'ont really know the order of the tests, it can be a little more complicated sometimes)

Upvotes: 2

jbpros
jbpros

Reputation: 1657

What about catching the exception in your step definition or underlying code?

Upvotes: 0

Related Questions