如何在空手道UI自动化框架中截取屏幕截图并保存当前日期和时间



如何在空手道UI自动化中截取屏幕截图并保存当前日期和时间

screenshot()API实际上返回一个Java字节数组。

如何处理该字节数组由您决定。karate.write()的用法只是一个例子,如果需要,请使用一些自定义代码。

* def bytes = screenshot(false)
* def file = karate.write(bytes, 'test.png')
* print 'screenshot saved to:', file