1

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?

Rahul Sankrutyan
  • 73
  • 1
  • 2
  • 10

0 Answers0