This repository contains the runner setup to execute the Selenium Automation Framework using Docker and Jenkins.
It provisions a Selenium Grid, pulls the prebuilt Docker image from DockerHub, runs tests in parallel on multiple browsers, collects reports, and then tears down the environment automatically.
- Jenkinsfile → Pipeline to orchestrate test execution (Grid up → Run tests → Cleanup).
- grid.yaml → Spins up Selenium Grid (Hub + Chrome + Firefox nodes).
- test_suites.yaml → Runs test containers against the Grid in parallel.
🔹 Builder Pipeline (Jenkinsfile defined in my Selenium Framework Repository)
The Docker image used here (pramesh11/selenium-docker-framework) is built and pushed from the main framework repository, which contains:
- Complete framework code (Selenium + Java + TestNG + POM).
pom.xmlfor Maven build.- Builder Jenkinsfile with stages to:
- Build the JAR (
mvn clean package). - Build Docker image.
- Push image to DockerHub (
pramesh11/selenium-docker-framework).
- Build the JAR (
This pipeline must run first, so that the latest Docker image is available on DockerHub.
- Grid Up →
grid.yamlstarts Selenium Hub and browser nodes. - Test Execution →
test_suites.yamlruns tests using the prebuilt Docker image:- Runs in Chrome and Firefox.
- Stores reports in
./output/test_resultsX.
- Validation → Jenkins pipeline checks for failed tests (
testng-failed.xml). - Teardown → All containers are stopped and cleaned automatically.
-
Two pipelines are needed:
- Builder Job (from framework repo) → Builds & pushes Docker image.
- Runner Job (this repo) → Executes tests on Selenium Grid.
-
Run the Builder Job first, then the Runner Job.
# Start Selenium Grid
docker-compose -f grid.yaml up -d
# Run tests (Chrome + Firefox)
docker-compose -f test_suites.yaml up --pull=always
# Stop and clean everything
docker-compose -f test_suites.yaml down
docker-compose -f grid.yaml down
📊 Test Reports
Reports are generated inside the output/ directory:-
- output/test_results1 → Chrome execution results
- output/test_results2 → Firefox execution results
👨💻 Author: Pramesh Kumar
Thanks!