Rerun failed cases

While executing the feature file using the “behave” command we need to pass below arguments.So that it will copy all the details whichever test cases are failed while execution.

Arguments such as “-f rerun -o fileName.feature” . Here we can define any name “fileName.feature” to copy failed test details.



-f : format
-o : output file

behave -f rerun -o failed_testcases.feature

The above command will copy failed cases into “failed_testcases.feature” file

Command to run failed cases feature file

We need to use the “@” symbol before the feature file name to execute the feature file which has failed cases.

This feature file will not have any steps like (Given ,When,Then,And ,But).So that we need to use @ symbol to execute.


behave @failed_testcases.feature