Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Run your existing Selenium test command in a Jenkins Pipeline stage on an agent that can launch the browser, capture screenshots from the active WebDriver session, and archive the resulting files in a post action. Capture at meaningful UI checkpoints—especially when a test fails. A screenshot is useful evidence, but it is not a visual-regression test unless you also compare it with a reviewed baseline using a comparison method and an explicit policy for acceptable differences.
How the pipeline fits together
Selenium WebDriver drives a browser; Jenkins runs the test command and retains its outputs. Selenium describes WebDriver as its core browser-automation interface, and its language bindings use Selenium Manager by default to manage browsers and drivers. That default does not guarantee that a particular Jenkins agent has the required browser installed or can reach your test environment. Confirm both on the agent you select. Selenium documentation
- Prepare a Jenkins agent that can run the chosen browser and access the application under test.
- Run the same Selenium test command you use outside Jenkins, where possible.
- Save screenshots in a predictable directory inside the job workspace.
- Use Pipeline post actions to publish or archive screenshots and test reports, including after test failure.
- If you need visual regression, compare captures with reviewed baselines in a separate step.
Capture screenshots from the Selenium test
Take the image from the browser session already controlled by the test. Capture after the page reaches the state you want to inspect, not merely after navigation begins. A small helper keeps filenames and output paths consistent. This Python example uses Selenium’s WebDriver screenshot method and writes a PNG into the workspace:
from pathlib import Path
from selenium.webdriver.remote.webdriver import WebDriver
SCREENSHOT_DIR = Path("target/screenshots")
def save_screenshot(driver: WebDriver, name: str) -> Path:
SCREENSHOT_DIR.mkdir(parents=True, exist_ok=True)
path = SCREENSHOT_DIR / f"{name}.png"
driver.save_screenshot(str(path))
return path
def test_checkout_page(driver):
driver.get("https://example.test/checkout")
# Wait for the application state that matters before capturing.
driver.find_element("css selector", "[data-testid='checkout-form']")
save_screenshot(driver, "checkout-ready")
Replace the example URL and selector with your application and a reliable readiness condition. For failure evidence, capture in the test framework’s failure hook or exception-handling path while the driver session is still available. Keep the original test failure visible: a screenshot-writing error should not silently turn a failed test into a pass or obscure the underlying exception.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
Choose meaningful capture points
- Capture after the page or component reaches the state being tested. A readiness condition tied to the UI is usually more useful than an arbitrary pause.
- Capture important intermediate states when they help diagnose navigation, loading, or interaction failures.
- Capture on failure before quitting the browser. If the driver is already closed, it can no longer provide the live page image.
- Use stable, descriptive names that include the test or state. Avoid names that overwrite another test’s output.
Keep paths inside the workspace
Use a consistent directory such as target/screenshots, or adapt it to the project and test runner. The Jenkins UI Test Capture plugin documents that directory convention and associating images with test-result data; it is a plugin-specific convention, not a Selenium requirement. The plugin page describes viewing screenshots for failed tests. UI Test Capture plugin
Run the tests and retain artifacts in Jenkins
For a Declarative Pipeline, run the normal test command in a stage and archive outputs in post. The always condition is useful when you want artifacts retained whether the test stage succeeds or fails. Jenkins also supports conditions such as failure and unsuccessful. The exact report and artifact steps available depend on the Jenkins installation and plugins. Jenkins Pipeline Syntax
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
pipeline {
agent { label 'selenium-browser' }
stages {
stage('Selenium tests') {
steps {
// Use the same test command as the project's normal workflow.
sh 'pytest -q'
}
}
}
post {
always {
archiveArtifacts artifacts: 'target/screenshots/**/*.png',
allowEmptyArchive: true
junit testResults: 'target/surefire-reports/*.xml',
allowEmptyResults: true
}
}
}
This example assumes a Unix-like agent, a Python test command, and JUnit XML output at the shown path; change the command and report pattern to match your project. allowEmptyArchive and allowEmptyResults let a build continue if no matching file exists, but they can also hide a path or test-runner mismatch. If artifacts are unexpectedly missing, check the workspace and generated paths rather than relying on those options as proof that capture worked. Use your Jenkins installation’s available artifact step if archiveArtifacts or junit is not available in the expected form.
Publish screenshots when tests fail
Keep screenshot archiving in a post { always { ... } } block when failure evidence matters. A command that runs only after a successful test stage will miss the most useful captures. Jenkins post conditions are part of Pipeline syntax; the screenshot files themselves must already have been written in the workspace before Jenkins can archive them.
Rank #3
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Optional reporting plugins
Plain workspace files and Jenkins artifact retention are often sufficient when the team only needs to download and inspect images. For a richer report view, evaluate plugins against your Jenkins version and maintenance needs before adopting them. The Selenium HTML Report plugin documents scanning a Selenium result directory for HTML files and copying them under seleniumReports in the build root. Selenium HTML Report plugin
The Jenkins Selenium plugin page describes Selenium 3 Grid integration and currently displays an unresolved security vulnerability warning and an adoption notice. It is not a required default for running Selenium tests in Pipeline; check the current plugin page and compatibility before considering installation. Selenium plugin
Rank #4
Make screenshot comparisons meaningful
A saved image proves what the browser rendered at one point; it does not decide whether that rendering is correct. A visual test also needs a baseline, an image-comparison method, and a team-approved policy for differences. The Selenium and Jenkins sources cited here do not prescribe a particular visual-diff library or a universal tolerance.
- Review and manage baselines deliberately rather than treating the first captured image as permanently correct.
- Keep relevant rendering inputs consistent, including browser, viewport, test data, and the application state under test.
- Choose how the project handles differences, including which changes require review and which are acceptable. Set the policy in the selected comparison tool or test code; it is not a Selenium or Jenkins default.
- Retain both the new capture and enough test output to identify which test, environment, and state produced it.
Choose a local agent or Selenium Grid
A single prepared Jenkins agent is the simpler choice when one controlled browser environment meets the test requirement. Selenium Grid is intended to distribute tests across multiple machines and run across browser and operating-system combinations. That broader environment coverage comes with Grid setup, capacity, and troubleshooting work. The official Selenium overview describes Grid’s role but does not establish a general winner, cost, or runtime advantage. Selenium Overview
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsBest Value
| Choice | Execution and coverage | Operational trade-off | Evidence handling |
|---|---|---|---|
| One Jenkins agent | Tests run in the browser environment prepared on that agent. | Keep the agent and its browser environment configured and maintained. | Write images to the workspace and retain them with Pipeline artifact handling. |
| Selenium Grid | Distributes tests across machines and supports browser and operating-system combinations. | Plan and operate Grid capacity and diagnose distributed execution. | Capture and retain screenshots through the test and Jenkins artifact workflow; Grid itself does not replace that workflow. |
Troubleshoot missing or unreliable screenshots
No screenshot file appears in the build
- Confirm the test reached the capture code and that the screenshot directory is inside the Jenkins workspace.
- Check that the archive glob matches the actual filename, extension, and directory. Compare it with the test runner’s output path.
- Verify the agent can write to the directory. An empty-artifact allowance prevents an archive step from failing, but it does not create a missing image.
The browser or driver does not start
- Check that the selected Jenkins agent can run the chosen browser and has the required environment configuration.
- Selenium bindings use Selenium Manager by default for automated browser and driver management, but that behavior does not guarantee the browser is installed or that the agent can obtain everything it needs. Confirm browser availability and agent connectivity in the actual CI environment. Selenium documentation
The image shows a loading or incomplete page
- Wait for the relevant application state or element before capture rather than assuming that navigation completion means the interface is ready.
- Check whether the agent can reach the test environment and whether the application state or test data differs from local runs.
- If the image is a visual baseline, align the browser and viewport conditions used to create and compare it.
Failure evidence is missing after a failed test
- Make sure capture runs before the test framework quits the WebDriver session.
- Put archiving in a Jenkins post condition that runs on failure, such as
always, rather than only after a successful stage. - Inspect the test output for a screenshot exception so a capture problem is not mistaken for the original test failure.
Or skip the browser setup
If you need a rendered website capture rather than a screenshot from the Selenium session driving your test, ScreenshotNeo offers a website screenshot API and MCP server. For example, request a PNG, JPEG, WebP, or PDF capture with one GET request (this saves the response as a WebP file):
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 and consent banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo free to get 1,000 screenshots a month with no card.
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.

