Sign inSign up

nitishjha72/selenium-java-docker-gha

By nitishjha72

•Updated 9 months ago

Real-world Selenium automation framework image using Java, Docker, Selenium Grid & GitHub Actions.

Image
Languages & frameworks
0

937

nitishjha72/selenium-java-docker-gha repository overview

⁠🐳 Selenium Java Docker GHA – Test Runner Image

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.

ā šŸš€ What This Image Is Used For

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.

⁠🧱 Core Capabilities

  • 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)

ā šŸ—ļø Designed for Real-World Test Infrastructure

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

ā ā–¶ļø Typical Usage Pattern

⁠1ļøāƒ£ Start Selenium Grid (separately)
docker-compose -f grid.yaml up --scale chrome=2 -d

or

docker-compose -f grid.yaml up --scale firefox=2 -d
⁠2ļøāƒ£ Run Tests Using This Image
BROWSER=chrome docker-compose -f test-suite.yaml up

or

BROWSER=firefox docker-compose -f test-suite.yaml up

ā šŸ”„ CI Usage (GitHub Actions Example)

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

ā šŸ“Š Reporting

  • Extent HTML Reports

  • Generated after every run

  • Mounted via Docker volumes

  • Uploaded as CI artifacts

ā ā° Scheduled Execution Support

Designed to run via cron-based CI schedules.

Example (GitHub Actions – Weekly run):

schedule:
  - cron: "0 5 * * 1"

⁠🧠 Why This Image Is Production-Ready

  • Clean separation of concerns

  • Stateless & reusable

  • Scales horizontally

  • CI-optimized startup

  • Designed using industry best practices


ā šŸ‘Øā€šŸ’» Maintainer

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⁠

ā šŸ’¬ Feedback & Support

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.

⁠Nitish Kumar Jha
⁠Automation | Selenium | Docker | CI/CD | Java

Tag summary

Content type

Image

Digest

sha256:53f71f8f1…

Size

141.9 MB

Last updated

9 months ago

docker pull nitishjha72/selenium-java-docker-gha