Real-world Selenium automation framework image using Java, Docker, Selenium Grid & GitHub Actions.
937
A production-grade Docker image for executing Selenium + TestNG automation tests against a Dockerized Selenium Grid, designed for local runs, CI pipelines, and GitHub Actions.
This image contains only test execution logic and is intentionally decoupled from Selenium Grid infrastructure, making it reusable, scalable, and CI-friendly.
This Docker image is responsible for:
Running Selenium TestNG tests
Connecting to a remote Selenium Grid
Supporting parallel execution
Enabling cross-browser testing
Generating Extent HTML reports
ā ļø Note: This image does NOT start Selenium Grid. Grid (Hub + Nodes) must be started separately.
Java + TestNG based automation
Selenium Grid (Remote WebDriver) support
Parallel execution using TestNG thread configuration
Cross-browser execution (Chrome / Firefox / Edge)
Retry mechanism for flaky test stabilization
Extent Reports for rich HTML reporting
Data-driven testing (CSV & Excel utilities)
Environment-agnostic configuration
CI/CD ready (GitHub Actions, Jenkins, GitLab CI)
This image is built to work with:
Docker Compose based Selenium Grid
Dynamic browser node scaling
GitHub Actions Matrix strategy
Local developer machines
Cloud CI runners
ā Same image works locally and in CI
ā No environment-specific code
ā No Grid lifecycle coupling
docker-compose -f grid.yaml up --scale chrome=2 -d
or
docker-compose -f grid.yaml up --scale firefox=2 -d
BROWSER=chrome docker-compose -f test-suite.yaml up
or
BROWSER=firefox docker-compose -f test-suite.yaml up
This image is commonly used with a matrix strategy:
strategy:
matrix:
browser: [chrome, firefox]
docker-compose -f grid.yaml up --scale ${{ matrix.browser }}=2 -d
BROWSER=${{ matrix.browser }} docker-compose -f test-suite.yaml up
ā Automatic cross-browser execution
ā Dynamic Grid scaling
ā Same test image reused
Extent HTML Reports
Generated after every run
Mounted via Docker volumes
Uploaded as CI artifacts
Designed to run via cron-based CI schedules.
Example (GitHub Actions ā Weekly run):
schedule:
- cron: "0 5 * * 1"
Clean separation of concerns
Stateless & reusable
Scales horizontally
CI-optimized startup
Designed using industry best practices
This Docker image is built and used by my GitHub project:
š Selenium Java Docker GHA Framework š https://github.com/nitishjha72/Selenium-Java-Docker-GHA-Frameworkā
If you find this image or framework useful:
ā Give the GitHub repository a star
š” Share feedback or suggestions
š¤ Contributions and improvements are welcome
Your feedback helps improve and evolve this framework further.
Content type
Image
Digest
sha256:53f71f8f1ā¦
Size
141.9 MB
Last updated
9 months ago
docker pull nitishjha72/selenium-java-docker-gha