Friday, May 29, 2020

Executing the failed test multiple times in SpecFlow

https://www.softpost.org/specflow/executing-the-failed-test-multiple-times-in-specflow/

When you use the SpecFlow runner to execute the tests, a special type of file with name default.srprofile is created in the project.

In this file, we can configure one parameter called as StopAfterFailure which can be used to re-execute the failed tests.


So if we set the value of this parameter as 2, SepcFlow runner will execute the scenario 2 times in case the scenario fails in the first run. If you set that parameter as 3, scenario will be executed 3 times in case scenario fails in first 2 runs and so on.

Below image shows the sample default.srprofile file and stopAfterFailures parameter as well.


stopAfterFailures parameter in SpecFlow default.srprofile file


No comments:

Post a Comment