Behave – Retry Mechanism

Behave - Retry Mechanism

We can rerun failed Scenarios in the feature file in Behave Retry Mechanism. This is taken care of with the help of the formatters.

All the available formats in Behave Retry Mechanism can be seen with the command given below โˆ’

behave โ€“f help

You can see the following screen after using the command โˆ’

The rerun formatter is used to capture the failing scenario and output it in a separate file. Let us take an example, where we have 1 failed feature.

Behave - Retry Mechanism

Then capture the failed feature in another feature file with the command โˆ’

behave โ€“f rerun โ€“o failed_features.feature

You can see the following โˆ’

The failed_features.feature file gets generated within the project. It contains the feature file name Payment1.feature where we have a failure.

To re-trigger only failed Scenario, we have to run the command stated below โˆ’

behave @failed_features.feature

You will see the following screen โˆ’

Behave - Retry Mechanism

Next Topic – Click Here

This Post Has One Comment

Leave a Reply