English 中文(简体)
Behave - Retry Mechanism
  • 时间:2024-12-22

Behave - Retry Mechanism


Previous Page Next Page  

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

All the available formatters in Behave can be seen with the command given below −


behave –f help

You can see the following screen after using the command −

Retry Mechanism

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

Rerun Formatter

Then capture the failed feature in another feature file with the command −


behave –f rerun –o failed_features.feature

You can see the following −

virtualbox

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

Feature file with the command

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


behave @failed_features.feature

You will see the following screen −

Re-trigger only Failed Scenario Advertisements