RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v3]
Kevin Rushforth
kcr at openjdk.org
Tue Apr 1 22:44:57 UTC 2025
On Tue, 1 Apr 2025 21:17:35 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
> We might still provide general purpose methods in ScreenCapture (new class) like
That might work. So the idea would be a utility class not tied to a JUnit5 annotation? The usage would then be adding a call to that while debugging a test wherever it makes sense for your test, possible from an AfterEach method.
> public static byte[] takeScreenshot() throws IOException {
What would this do? I can see the usefulness of returning a WritableImage (basically calling `Robot::getScreenCapture` on the whole screen) or a base64-encoded PNG file, but what does it mean to return a raw byte array? I probably wouldn't recommend this one.
> public static String takeScreenshotBase64(String prefix, String postfix) {
This seems useful, although what are "prefix" and "postfix" for?
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1746#issuecomment-2770843700
More information about the openjfx-dev
mailing list