In this tutorial, we’ll walk you through the process of integrating your Maven-based Selenium automation project with Jenkins to set up a fully automated Continuous Integration (CI) pipeline.
Whether you’re a QA engineer, developer, or DevOps professional, this video will show you how to connect your tests to Jenkins for seamless, automated testing every time you commit code.
What You'll Learn:
Why Jenkins is essential for Selenium + Maven projects
How to set up Jenkins and configure it with Maven and JDK
Step-by-step guide to create Jenkins jobs (Freestyle or Pipeline)
How to automate test execution with Git triggers and scheduled runs
How to publish TestNG results and HTML reports in Jenkins
🛠️ Step-by-Step Integration:
🔹 1. Install Jenkins
Download Jenkins: Head over to Jenkins download page, select the appropriate version for your OS, and install it.
Access Jenkins: By default, Jenkins runs on http://localhost:8080.
🔹 2. Install Required Jenkins Plugins
Go to: Manage Jenkins - Plugins
Install the following:
✅ Maven Integration Plugin
✅ TestNG Results Plugin
✅ Git Plugin (for repository integration)
✅ HTML Publisher Plugin (for publishing reports)
🔹 3. Configure Maven & JDK in Jenkins
Go to: Manage Jenkins - Global Tool Configuration
JDK: Add your local JDK path (e.g., C:\Program Files\Java\jdk-21).
Maven: Add your Maven path (e.g., C:\apache-maven-3.9.6).
🔹 4. Create a New Jenkins Job
Click on New Item.
Name your project (e.g., selenium-maven-tests).
Choose Freestyle project and click OK.
🔹 5. Configure the Job
Source Code Management: Add your Git repository URL.
Build:
Select Invoke top-level Maven targets.
Set the Goals field to: clean test.
Post-build Actions:
📊 Publish TestNG Results: Use the path **/testng-results.xml.
🧾 Publish HTML Reports: Set the report directory to target/surefire-reports and index file to index.html.
🔹 6. Run Your Jenkins Job
Click Build Now to start the job.
You’ll see the build process and logs appear.
Check the results in Jenkins, including your test logs and reports.
✅ Optional: Add Triggers for Automation
Poll SCM: Automatically trigger builds on code changes (e.g., H/15 * * * *).
Build Periodically: Schedule regular builds (e.g., @midnight or H 22 * * 1-5).
🚀 Summary:
Steps to Automate with Jenkins:
Write tests in Selenium + Maven.
Build with Maven: mvn clean test.
Set up Jenkins (Freestyle or Pipeline).
Automate test execution via Git webhook or scheduled triggers.
🎯 Next Steps:
Would you like to receive email/Slack alerts when tests fail?
Interested in adding parallel test execution in Jenkins?
Need to store reports as artifacts or integrate Allure for enhanced reporting?
🔖 Hashtags:
#JenkinsCI, #SeleniumAutomation, #MavenSetup, #ContinuousIntegration, #TestNG, #JenkinsPipeline, #QAEngineer, #SeleniumTest, #AutomatedTesting, #CI_CD, #MavenJenkins, #DevOps, #BuildTools, #AutomationTesting, #JenkinsForQA, #SeleniumWithJenkins, #MavenForTestAutomation, #JenkinsFreestyleProject, #MavenCI, #JenkinsConfiguration