Forum Discussion
Having the same name for Feature and Scenario, makes it confusing to diagnose the issue.
Note, "The purpose of the Feature keyword is to provide a high-level description of a software feature, and to group related scenarios".
In the code that I have provided, I am using the parameter feature that is passed to AfterFeature function.
rraghvani I got what was wrong on my side.
My requirement is to execute the particular Teardown in both cases:
- When the whole feature file gets executed and returns success.
- When any scenario from that feature file fails.
In the first case, everything works as expected as you mentioned.
But when I get into 2nd case teardown doesn't work properly.
You can try failing any scenario from GroupFeature.
In this case,
Features.Item(i).Scenarios.Item(j).Run();
This won't get executed.
Could you please help me to fix this case?
Is there any configuration we need to change to make it work?
Thank you.