Forum Discussion
TarekO
4 years agoNew Contributor
I have found a partial solution for my issue by using the After Hook:
@After
public void tearDown(Scenario scenario) {
if(scenario.isFailed()){
//Code here
}else if(scenario.getStatus().toString().equalsIgnoreCase("passed")){
//Code here
}
driver.quit();
}
However, the second part of my issue is to fetch the Reason why the Scenario failed. I have tried using the Arguments :
@After
public void tearDown(Scenario scenario, Step step) {
And cucumber does not support that. Is there a way I can access the failed step reason?
Related Content
- 2 years ago