Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteTo attach a screenshot to a JUnit XML test report, write a reference in the syntax your CI report viewer understands, then preserve the image file where that viewer can access it. There is no single attachment syntax supported by every JUnit XML consumer. GitLab documents an attachment marker in a test case’s <system-out> plus artifact upload; Jenkins attachment display requires the JUnit Attachments plugin or its documented file-layout convention.
How JUnit XML screenshots work
JUnit XML records test results, but the XML format alone does not guarantee that a screenshot will be attached, retained, or shown in a web interface. Treat this as three separate tasks:
- Capture: Save the screenshot to a file during the test run.
- Reference: Emit the file path or attachment marker in the convention parsed by your report viewer.
- Retain and display: Upload or archive the image, then confirm the CI interface can resolve the reference.
A format guide describes several conventions—including file or URL properties, inline data URIs, and [[ATTACHMENT|...]] lines in system-out or system-err—but these are not universally implemented. Check your viewer’s documentation rather than assuming a marker that works in one CI system will work in another. The JUnit XML format guide describes conventions; the vendor-specific workflows below establish what GitLab and Jenkins document.
Attach screenshots in GitLab CI/CD
GitLab’s documented approach is to put [[ATTACHMENT|path]] in the relevant test case’s <system-out> element and upload both the JUnit XML report and screenshot as job artifacts. GitLab says the path is relative to $CI_PROJECT_DIR, and the screenshot link can be opened from the failed test’s details. See GitLab’s Unit test reports documentation.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Example XML
Assume the test writes screenshots/test_checkout.png in the job’s project directory. The testcase’s output can contain:
<testsuite name="CheckoutTests" tests="1" failures="1">
<testcase classname="CheckoutTests" name="paymentFailsGracefully">
<failure message="Expected confirmation message"/>
<system-out>[[ATTACHMENT|screenshots/test_checkout.png]]</system-out>
</testcase>
</testsuite>
The path in the marker must match the file’s actual location relative to $CI_PROJECT_DIR. If your framework generates the XML, add the marker to the testcase output through that framework’s supported output mechanism or post-process the report before the job ends. Preserve valid XML escaping if you write or transform XML yourself.
Upload the report and image
Configure the job to expose both files. A representative configuration is:
test:
script:
- ./run-tests
artifacts:
when: always
reports:
junit: build/test-results/*.xml
paths:
- build/test-results/
- screenshots/
Replace the paths with the locations used by your test command. GitLab documents artifacts:when: always as an optional way to retain files even when tests fail. For screenshot links to work, the path named in the XML must resolve to an uploaded screenshot; uploading only the XML leaves the report with a broken reference.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Attach screenshots in Jenkins
Jenkins’ ordinary JUnit publisher consumes XML reports and provides a web UI and historical result trends. Screenshot display is an additional capability provided by the JUnit Attachments plugin, not an automatic feature of every JUnit XML report. The plugin documents two approaches: place files in a directory named after the test class beside the XML report, or print a standalone [[ATTACHMENT|...]] path line to standard output or error. It documents inline display for image attachments.
Use the test-class directory convention
Place each test class’s screenshots in a same-report-directory subdirectory named for that class, following the plugin’s documented layout. This keeps related files alongside the XML report and avoids depending on parsing test output. Use the exact class name and directory placement expected by the plugin, and ensure the job retains the report directory long enough for Jenkins to publish the attachments.
Print an attachment marker
Alternatively, have the test emit a standalone line such as:
[[ATTACHMENT|/absolute/path/to/some/file.png]]
The plugin parses the marker from standard output or error. Use an absolute path that exists in the Jenkins job environment when the publisher processes it. The marker is a separate plugin convention; do not expect the standard JUnit publisher alone to interpret it.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Publish JUnit results and attachments
Configure the Jenkins job to publish the XML results with its JUnit publisher, and enable the JUnit Attachments plugin’s publish-test-attachments feature for the attachments. Exact UI configuration may vary with the installed Jenkins and plugin versions, so use the installed step’s reference and plugin documentation. Jenkins notes that retaining large standard output or error can increase memory consumption; avoid dumping image data or excessive logs into test output.
The JUnit publisher’s step reference is available at Jenkins Pipeline: JUnit. It covers XML result publication and related options; attachment parsing remains the plugin’s role.
Choose a convention for other JUnit XML viewers
For other CI systems and report viewers, verify the precise syntax they parse and their file-retention model before changing the test framework. A marker, property, URL, or data URI mentioned in a format guide is not proof that your target viewer implements it.
- Syntax: Does the viewer parse an attachment property, a data URI, a system-output marker, or another format?
- Path semantics: Is the path expected to be relative to the workspace, absolute on the runner, or a hosted URL?
- Persistence: Are local files uploaded as artifacts, archived by a plugin, or deleted when the job ends?
- Display location: Does the image appear inline, in a test-details panel, or only as a downloadable artifact?
- Retention cost: How much storage and log output will the screenshots add, and for how long are they needed?
JUnit 5’s user guide covers test output and report generation, but it does not establish automatic screenshot attachment behavior for every CI consumer. Framework output, XML syntax, CI artifact persistence, and UI display are separate concerns. See the JUnit 5 User Guide and the documentation for your CI viewer.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Capture screenshots reliably in tests
Save images only when they help diagnose a failure, and give each file a predictable name that identifies the test without collisions. A practical naming scheme includes the test class and method, with unsafe characters normalized. If tests run in parallel, use a unique suffix or per-test directory so concurrent tests cannot overwrite each other.
- Write screenshots under the CI workspace or another directory the job can upload or archive.
- Make the XML reference use the path form required by the target consumer; do not assume a path valid on the runner is valid in the report viewer.
- Generate screenshots and XML before artifact collection or publication runs.
- When reports are produced after failures, configure artifact retention to include failure cases.
- Keep image dimensions and output counts proportionate to debugging needs; large retained outputs can increase storage use, and Jenkins specifically warns about memory costs from large retained stdout/stderr.
If you use JUnit 5, its output capture and XML/report generation do not by themselves guarantee that a CI viewer will attach screenshot files. Add the consumer-specific reference and retention configuration independently.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot missing or broken attachments
The report shows no screenshot link
- Confirm the exact marker or attachment mechanism is supported by your report viewer. Jenkins marker parsing requires the JUnit Attachments plugin; GitLab documents its marker in testcase-level
system-out. - Check that the marker is inside the correct testcase output, not only in a general build log.
- Verify that the attachment publishing feature or job artifact configuration is enabled.
The link appears but the image cannot be opened
- Compare the referenced path with the actual file location and capitalization.
- For GitLab, make the marker path relative to
$CI_PROJECT_DIRand include the image in artifact paths. - For Jenkins’ output-marker route, ensure the absolute path exists when the plugin processes the report.
- Check that artifact collection or report publication is not running before screenshot generation completes.
Attachments disappear on failed jobs
Configure failure-safe retention. GitLab documents artifacts:when: always as an optional setting for preserving files when tests fail. For Jenkins, verify that the attachment plugin and result publisher run on the relevant build outcomes and that the report directory is retained.
Jenkins uses excessive memory
Review how much stdout and stderr the JUnit publisher retains. Jenkins cautions that keeping large output can increase memory consumption. Prefer file-based attachments over logging image contents, and limit diagnostic output to what is useful.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Or skip the browser setup
If a failure screenshot needs to come from a live page rather than a browser session already running in your test, ScreenshotNeo provides a one-request screenshot API. It can return PNG, JPEG, WebP, or PDF, and supports options such as full-page capture, CSS selectors, viewport and device settings, custom headers or cookies, and waits. After capture, attach the saved image using the GitLab or Jenkins workflow above; the API does not replace CI artifact retention or report-viewer syntax. See ScreenshotNeo and its API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server lets AI agents use screenshot tools, and the Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.
Frequently Asked Questions
Does JUnit XML have a standard screenshot attachment element?
No universal attachment element is guaranteed across JUnit XML consumers. Use the syntax documented by your specific CI report viewer.
Will JUnit 5 automatically show screenshots in my CI report?
Not necessarily. Framework report generation, attachment syntax, file retention, and CI display are separate steps.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

