1

How to take screenshot and save it with a current date and time in Karate UI Automation.

mohan raul
  • 11
  • 1

1 Answers1

0

The screenshot() API actually returns a Java byte-array.

What you do with that byte-array is up to you. The karate.write() usage is just an example, please use some custom code if needed.

* def bytes = screenshot(false)
* def file = karate.write(bytes, 'test.png')
* print 'screenshot saved to:', file
Peter Thomas
  • 54,465
  • 21
  • 84
  • 248