Skip to main content

Posts

Showing posts with the label screenshot

Multiplatform Java solution to take a screenshot in your tests

This small chunk of code will help you to take a screenshot of entire screen on any platform. It is especially helpful in test automation frameworks to add "take a screenshot on failure" functionality. captureScreen method accepts the filename of the image to be produced in PNG format including the full path (absolute or relative to the working directory), e.g. "out/screenshots/myscreen.png"