Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript-Selenium Docker Demo

A demonstration repository for running JavaScript Selenium tests inside Docker containers.

About

This project shows how to execute Selenium test scripts using Docker, enabling you to run tests in Chrome, Edge, and Firefox browsers without installing browser dependencies or headless browsers locally. All browsers run inside Docker containers, providing a portable and consistent test environment.

Prerequisites

  • Docker (Docker Desktop or similar)
  • Node.js (Latest LTS version recommended)

Getting Started

  1. Start Docker Desktop
    Ensure Docker is running on your machine.

  2. Start Browser Containers
    Navigate to the project directory and run:

    docker-compose up
    

    This command launches the necessary browser containers for Selenium.

  3. Run Selenium Tests
    In a separate terminal, navigate to the project directory and execute:

    node test.js
    

    This runs the Selenium test scripts within the Docker browser environments.

Why Use Docker for Selenium?

  • No Local Browser Dependency: Eliminates the need to install browsers on your host machine.
  • Consistent Environment: Ensures tests are not impacted by changes or updates to browsers or local machine configurations.
  • Easy Browser Version Control: Quickly run tests against specific or older browser versions by swapping Docker images.
  • Machine Compatibility: Test environments remain the same regardless of where they're run, reducing "it works on my machine" issues.

About

This project shows how to execute Selenium test scripts using Docker, enabling you to run tests in Chrome, Edge, and Firefox browsers without installing browser dependencies or headless browsers locally. All browsers run inside Docker containers, providing a portable and consistent test environment.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages