How to take screenshot and save it with a current date and time in Karate UI Automation.
Asked
Active
Viewed 512 times
1 Answers
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