How to rerun Cucumber failed scenarios?


In this blog article, we will walk you through how to rerun jvm-Cucumber failed scenarios.

Step #1 Configure where you want to store failed scenario details in Runner class
Note: Use rerun variable in CucumberOptions to store the failed scenarios.
Step #2 Create a new Runner class to run the failed scenarios.
Note: In the ‘features’ variable, you need mention the failed_scenarios.txt file and don’t forget that you must mention ‘@’ symbol before the file path.
If you are running your automated test scripts from Jenkins, you can create and configure a downstream job to run the failed scenarios.

Leave a Reply

Your email address will not be published. Required fields are marked *