Declare Selenium’s Java binding in your Maven project, run the project’s Maven lifecycle from a Jenkins Pipeline, and publish the resulting test reports. The essential path is pom.xml → Jenkins agent with the required Java and Maven → mvn clean verify → Surefire or Failsafe reports published in Jenkins.
1. Add Selenium to the Maven project
Add Selenium’s Java binding, org.seleniumhq.selenium:selenium-java, as a dependency in pom.xml. Keep its version in a project property so it is easy to manage, and check the Selenium downloads page and your Java/browser setup before selecting a version. No single compatibility matrix covers every Java, Selenium, browser, and driver combination.
As an Amazon Associate I earn from qualifying purchases.
<properties>
<selenium.version>REPLACE_WITH_A_VERIFIED_VERSION</selenium.version>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
</dependency>
</dependencies>
Replace the version value with one checked for your project; the token shown is an instructional placeholder, not a valid version. Selenium’s official installation instructions cover Maven dependency setup: Selenium WebDriver installation.
Place tests and configure their names and lifecycle so Maven’s intended test plugin discovers them. Surefire executes tests in Maven’s test phase; integration-style suites may instead be organized around Failsafe and later lifecycle phases. Selenium tests are not required to use one classification: choose based on how your suite should run and report.
#1 Best Overall
2. Prepare Jenkins and its build agent
The Jenkins agent that runs the job needs the Java runtime and Maven required by the project, as well as access to the browser environment the tests expect. You can use tools installed on the agent or configure Maven and JDK installations in Jenkins. The Pipeline Maven Integration plugin’s withMaven step can select configured installations and provide Maven settings from Jenkins configuration or an explicit settings-file configuration.
Install the Pipeline Maven Integration plugin from the Jenkins Update Center only after checking that its current release supports your Jenkins core version. The release listed for July 30, 2026, was 1760.v9a_a_e6dcb_0444 and required Jenkins 2.528.3; plugin versions and requirements can change. Its documentation states that Maven build detection requires Maven 3.2 or later; this is the documented detection requirement, not a recommendation that every project use that version.
Keep repository credentials out of the POM and Jenkinsfile. Use your organization’s approved Jenkins credential and Maven settings configuration; the appropriate credential setup depends on your Jenkins environment.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteRank #2
3. Run Maven from a Jenkins Pipeline
A Declarative Pipeline can check out the repository, select the Jenkins-configured JDK and Maven, and run the lifecycle goal that includes your browser suite. This example is a template: replace the tool names and agent label as needed, and ensure the project’s Maven configuration includes the tests you want to run.
pipeline {
agent any
stages {
stage('Test') {
steps {
checkout scm
withMaven(maven: 'configured-maven', jdk: 'configured-jdk') {
sh 'mvn clean verify'
}
}
}
}
}
configured-maven and configured-jdk must match installations configured in Jenkins. The example uses a Unix shell step. On a Windows agent, use the appropriate batch step instead. The Pipeline Maven plugin documents Linux, Windows, and macOS agents.
mvn clean verify cleans prior build output and runs Maven through the verification phase. The Pipeline Maven plugin documents this invocation pattern; withMaven prepares the Maven environment and can discover generated Maven artifacts and supported Surefire/Failsafe reports. If your project’s suite is assigned to another lifecycle phase, choose the corresponding Maven goal rather than assuming every Selenium suite belongs in verify.
Rank #3
4. Publish and inspect test results
Jenkins can display results only when Maven generated reports and a compatible publisher is configured. The Pipeline Maven Integration plugin can publish Surefire and Failsafe reports through its publishers. JUnit report publication requires the Jenkins JUnit plugin. For formats or tests not automatically detected, configure the matching publisher and report path.
- After the Maven step, check whether report files exist in the expected Surefire or Failsafe output location.
- Confirm the reports contain test cases and were generated by the suite that Jenkins actually ran.
- Confirm the relevant Jenkins publisher is installed and configured; for JUnit publishing, install/configure the JUnit plugin.
- Inspect the Jenkins build’s test results and the Maven console output together if the report is missing or empty.
When tests fail, make sure the job still reaches report publication where possible. Configure the Pipeline so report processing runs even when Maven exits with a test failure; otherwise Jenkins may show a failed build without the test details needed to diagnose it. The exact Pipeline error-handling structure depends on the job and publisher configuration.
5. Choose a job style and browser execution setup
Pipeline or legacy Maven job
Use a Pipeline when you want the build definition alongside the project and explicit control over checkout, tools, Maven goals, and report handling. Jenkins’ Maven Integration documentation recommends moving away from the legacy Maven job type toward Pipeline or freestyle jobs. A freestyle job remains an option where it fits an existing setup.
Rank #4
Surefire or Failsafe
Use Surefire when the browser tests are configured as tests in Maven’s test phase. Use Failsafe when the suite is set up as integration tests in the corresponding later lifecycle phases. The plugin supports reports from both; project test naming and Maven configuration determine which executes and where reports are produced.
Agent-local browser or separate browser service
The documentation establishes how Jenkins runs Maven and publishes reports, but does not prescribe whether your browser should run locally, headlessly, or through a separately managed grid. Choose according to your infrastructure, then ensure the Jenkins agent can reach the browser and any external service and that the required browser configuration is available to the tests.
6. Troubleshoot common failures
Jenkins shows no test results
- Check Maven’s console output to verify that tests ran rather than being skipped or undiscovered.
- Confirm XML reports were generated in the expected Surefire or Failsafe location.
- Verify that the appropriate report publisher is installed and configured; JUnit publication requires the Jenkins JUnit plugin.
The build uses an unexpected Java version
Check the JDK installation selected in Jenkins and the jdk argument to withMaven. Compare the Java version visible in the build log with the version required by the project.
Best Value
The build works locally but not on the Jenkins agent
Compare the agent’s Java and Maven versions with the local environment. Also verify browser availability, relevant environment variables, and any external browser-service configuration. These environment differences are common diagnostic areas; the correct fix depends on the agent and test architecture.
A legacy Maven job behaves differently
Check which test plugins and report formats the job supports. For a maintainable migration path, move the build to a Jenkins Pipeline or freestyle job and explicitly configure Maven execution and report publication.
7. A simpler option for capturing web pages
If your goal is to collect page screenshots rather than run browser interactions and assertions, ScreenshotNeo is a website screenshot API and MCP server. It is not a replacement for Selenium tests that need to exercise or verify application behavior.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Or skip the browser setup
One GET request captures a URL. See the ScreenshotNeo API documentation for options and response details.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers identifying the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots.
Sign up for 1,000 free screenshots a month, with no card required.
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.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →




