I need to take a screenshot after each step of execution and embed them in results. I have tried using the "After" method but it captures only the last screen and displays it at the end of the report.


It seems you are already able to do most of the screenshot, the After you are using will only take a screenshot after everything, instead of after each step.

You need to do an @AfterStep inside your hooks file:

public void doSomethingAfterStep(Scenario scenario){

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.