RFR: 8328716: [TestBug] Screen capturing utility for failed tests

Andy Goryachev angorya at openjdk.org
Mon Mar 31 16:54:13 UTC 2025


On Fri, 28 Mar 2025 21:09:55 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> Introduce a facility, in the form of JUnit5 annotation, to allow for capturing a desktop screenshot of a failed test.
>> 
>> The primary intent is to be able to debug an intermittent test case, rather than wholesale addition of the new annotation to all the tests.
>> 
>> A possible improvement could be to output a data URL
>> 
>> `data:image/png;base64,iVBORw0KGgoAAAANSUhEU...`
>> 
>> so it can be rendered in Safari (Chrome truncates the image possibly due to following a url length limit)
>
> tests/system/src/test/java/test/util/ScreenCaptureTestWatcher.java line 67:
> 
>> 65:  */
>> 66: // TODO investigate having a hard-coded or programmable via property limit on the number of
>> 67: // captured screenshots.
> 
> I had the same thought. Given that each test runs in its own JVM, I can't think of a good way to do it other than recording information in a file in tests/system/build.

Exactly.  I don't have a good way, and I would rather not write to a file.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1746#discussion_r2021394385


More information about the openjfx-dev mailing list