In this post, we are going to learn how to automatically
retry our failed scenario in Cucumber-Junit Testing Framework. For this purpose, we have to use Extended Cucumber Runner which is basically an extension of Junit
Standard Cucumber.
Step 1: We need to download Cucumber-Runner maven dependency or Jar from this link. In this blog, I am using the below maven dependency.
Step 2: In Runner File now instead of @RunWith(Cucumber.class)
we need to use @RunWith(ExtendedCucumber.class) along with ExtendedCucumberOptions.
Now once any of our scenarios will get failed Extended
Cucumber Runner with automatically try to Rerun those failed scenarios number
of times we have specified in RetryCount under ExtendedCucumberOptions.
Hi Ankur,
ReplyThanks for this tutorial. I tried your approach, but facing an issue with Cucumber higher versions. Seems to be, Cucumber extended options are not compatible with higher versions of cucumber. Is there any way to make it work with higher versions?
tried above but getting exception
Replycucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
@Amit Jain that is because with newer version of cucumber that is not being supported
ReplyI try with the info.cuckes version of cucumber 1.2.5 not able to give retry while failing. @Ankur Jain, could you please share the pom.xml file which working with retry mechanism
Reply