Rahul Sankrutyan
Rahul Sankrutyan

Reputation: 163

How to get information about exception thrown in AfterScenario hook in Gauge framework?

I'm using Gauge framework with Java as part of the automation suite. We get the information whether a scenario is failing or not from the isFailing flag in executionContext.getCurrentScenario().
But can we get the reason it is failing - if assertion failed or some exception occurred, etc. - in AfterScenario?

There is a executionContext.getCurrentStep().getErrorMessage() and executionContext.getCurrentStep().getStackTrace() but they don't seem to give the required failed information. Is there any way we can do it?

Came across a similar question in cucumber framework here: How to get the exception that was thrown when a Cucumber test failed in Java? Can something similar be applied?

Upvotes: 1

Views: 108

Answers (0)

Related Questions