1

I am trying to capture a screenshot after any step failure in a called feature. I tried using

configure afterScenario = function(){ if (karate.info.errorMessage) driver.screenshot() } 

for that but realized that the hooks don't work for the called feature files. Is there any other way to achieve this?

Ken White
  • 120,522
  • 13
  • 212
  • 426

1 Answers1

0

Can you first upgrade to 1.0.1 and confirm, Karate should automatically take a screenshot and add it to the report on an error.

Else please go through this thread for ideas: https://github.com/intuit/karate/issues/1465

It may require you to dig into Karate internals and contribute code, so if you are not prepared to do that - you can opt for other alternative solutions.

Peter Thomas
  • 47,282
  • 14
  • 68
  • 196