What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
To keep Selenium screenshots from GitLab CI, save them inside the checked-out project (for example, screenshots/) and list that directory under the job’s artifacts:paths. Set artifacts:when: always to retain files after a failed job. If you also want a screenshot linked from a failed test’s details, upload JUnit XML with a GitLab attachment tag pointing to the image.
How to run Selenium screenshot tests in GitLab CI
The workflow has four parts: start a browser in the CI environment, write the screenshot to a project-relative path, upload that path as a job artifact, and optionally connect the image to a JUnit test report. GitLab stores and displays the files you upload; this setup does not automatically compare screenshots pixel by pixel.
- Configure Selenium and the intended browser for your runner, then navigate to the page under test.
- Create a screenshot directory under the checked-out project, such as
screenshots/. - Save the image there when a test fails, or at another point that is useful to your test workflow.
- Configure the GitLab job to upload the directory. Use
artifacts:when: alwayswhen screenshots must survive a failed job. - Optionally produce JUnit XML and link the image from a test’s
<system-out>using GitLab’s attachment syntax.
Selenium’s browser documentation shows WebDriver screenshot methods, including Python’s driver.save_screenshot('./image.png'). See Selenium: Working with windows and tabs.
Save a screenshot from a Selenium test
Python example
This minimal example creates the directory before writing. In a real test suite, put screenshot capture in the framework’s failure hook if you only want failure evidence, and configure the browser binary and driver for the runner image you use.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
from pathlib import Path
from selenium import webdriver
Path("screenshots").mkdir(parents=True, exist_ok=True)
driver = webdriver.Chrome()
try:
driver.get("https://example.com")
driver.save_screenshot("screenshots/example.png")
finally:
driver.quit()
Use a path under the project checkout, typically $CI_PROJECT_DIR. A relative path is resolved from the test process’s working directory, so confirm that the runner starts the test where you expect. If the test framework creates the directory itself, the explicit mkdir is optional.
Capture only when a test fails
Most test frameworks provide a teardown, fixture, or failure hook where you can check the test outcome and save the current browser state before quitting the driver. Keep that hook from masking the original test result: screenshot errors should be recorded, but should not turn a failing test into a successful one. The exact hook depends on the language and framework; Selenium’s capture call is the same once you have the active driver.
Upload screenshots as GitLab job artifacts
Add the image directory to the job’s artifacts:paths. Set when: always when the evidence matters even if the script exits unsuccessfully. GitLab’s artifact documentation covers viewing, downloading, access controls, and retention: Job artifacts.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
selenium_tests:
stage: test
script:
- python -m pytest
artifacts:
when: always
paths:
- screenshots/
This YAML shows artifact wiring, not a complete browser installation. Add the dependencies, runner image, browser startup, and test configuration that your project needs. Artifact paths must match the files’ actual location beneath the project checkout; files outside the checkout are not included by this path.
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 & 11Where to find the files
After the pipeline runs, open the job on the pipeline’s job details page and use its artifact browser or download the artifacts to inspect the images. Access and retention depend on your GitLab configuration and artifact settings. Review who can access artifacts if screenshots could expose credentials, personal data, or private application content.
Link screenshots from failed test details with JUnit
If your test framework writes JUnit XML, GitLab can make an image path available from the test’s failure details. Include the attachment tag in that test case’s <system-out>, and upload both the report and the screenshot directory:
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
<testcase name="test_example" classname="ExampleTests">
<failure message="Expected result was not visible" />
<system-out>[[ATTACHMENT|screenshots/failure.png]]</system-out>
</testcase>
selenium_tests:
stage: test
script:
- python -m pytest --junitxml=junit.xml
artifacts:
when: always
paths:
- screenshots/
- junit.xml
reports:
junit: junit.xml
The attachment path is relative to $CI_PROJECT_DIR; make it match the uploaded image path. The framework must actually generate the XML and the screenshot. GitLab’s instructions are in Unit test reports.
JUnit reports display test results but do not set the job’s success or failure status. GitLab states: “Unit test reports require the JUnit XML format and do not affect job status.” Your test command must therefore exit non-zero when tests fail; do not swallow that exit status while saving screenshots.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Choose a browser execution setup
Browser in the test job
Starting the browser in the test job keeps the browser and test process together and is often the simplest arrangement for a small suite. You still need a compatible browser, driver, and runner configuration. Pin the relevant image and browser versions in the project so an environment change does not silently alter rendering.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Remote Selenium service or Grid
A remote WebDriver endpoint or Selenium Grid can support execution across machines and browsers, but it adds endpoint availability, networking, and configuration concerns. Selenium describes Grid as a way to scale execution across multiple machines and browsers: Selenium documentation. GitLab’s example repository illustrates a Selenium service endpoint and notes that a service container cannot treat the job container’s localhost as its own: gitlab-selenium-server.
Choose based on the browser and operating-system coverage you need, runner networking, concurrency, reproducibility, and where screenshots and logs should be retained. Neither a local browser nor Grid is universally best; the endpoint must be reachable from the test process, and the browser environment must be able to reach the application under test.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Make screenshots useful for debugging or visual comparison
Diagnose failures
Inspect the screenshot alongside the test exception and browser state. The visible page can reveal a failed navigation, unexpected modal, incomplete load, or layout problem that an exception message alone does not explain. GitLab’s testing guide recommends using screenshots as part of failure diagnosis: Testing best practices. Save relevant logs or test output alongside images when useful, but do not put secrets in artifacts.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Keep visual runs comparable
For meaningful comparisons between runs, hold the browser version and viewport dimensions stable. Selenium’s documentation covers browser window sizing; actual page rendering can change with the window dimensions. Also consider stabilizing test data, fonts, animations, and time-dependent content in your own test design. These are project-level practices, not automatic GitLab or Selenium visual-diff features; the cited documentation does not prescribe a universal pixel-diff library, tolerance, or baseline policy.
Troubleshoot missing or unhelpful screenshots
- No screenshot appears in the job: Check that the test wrote the image under the checked-out project and that the relative path matches
artifacts:paths. Confirm the directory exists before capture and inspect the runner’s working directory. - Screenshots are present only on successful runs: Check that the job has
artifacts:when: always. Also confirm that the test command’s failure exit status is preserved. - The JUnit test has no clickable image: Verify that the JUnit report is uploaded with
artifacts:reports:junit, the image itself is included underartifacts:paths, and the attachment tag uses the correct project-relative path. - The job passes even though a test failed: JUnit display does not determine job status. Make sure the test command returns non-zero on failure and that wrapper scripts or cleanup code do not replace that status.
- Remote browser cannot reach the app: Check the URL from the browser service’s network context. In particular, a service container’s
localhostis not the job container’slocalhost; use an address reachable from the browser service. - Images differ unexpectedly between runs: Compare viewport and browser versions first, then check for changing data, animation, fonts, and time-dependent content.
- The screenshot itself is empty or shows the wrong page: Inspect the captured browser state and test output, and verify the navigation and timing conditions before capture. A screenshot records the current browsing context, not an assertion that the page reached the intended state.
Or skip the browser setup
If you need a screenshot of a public URL rather than evidence from the same Selenium session that just ran your test, ScreenshotNeo offers a one-request screenshot API. It cannot replace a Selenium test that must interact with your application or capture its exact authenticated browser state.
cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Learn more at ScreenshotNeo.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Recommended Free Tools
Further GitLab CI testing guidance
GitLab’s broader testing documentation describes test reports and CI testing workflows: Test with GitLab CI/CD. GitLab’s documentation is living documentation, so check the current instructions for your GitLab version, runner executor, and browser setup when implementing the job.
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.

