Friday 18 February 2022

How to setup Selenium Grid using Docker Desktop - Windows

                            Selenium Grid has made the test automation execution much faster and smarter. The excessive usage of selenium grid has its own hitches like too much of system resource utilization, all browsers to be installed on the system etc. 

With the introduction of docker images for selenium, made the life of testers lot easier. Out of multiple ways to bring up selenium grid with docker, I would choose the simple & quick way to bring up using docker-compose.

Pre-requisite: Docker desktop for windows is installed.


Steps to bring up Selenium Grid:

  • Pull required version of selenium hub and nodes using the command "docker pull" as below

         docker pull selenium/node-chrome-debug:3.141.59 

  • Create a yaml file with the below docker-compose instructions.
docker-compose file

  • run the command 
         docker-compose -f docker-compose.yml up -d


Well, That's it. Your local docker Selenium grid is up & running.  Open the Docker desktop dashboard to view the containers.



Grid is accessible on the url "http://localhost:4444/grid/console"



NOTE: 
  • I have used debug versions of chrome & firefox images as it will allow me view the live execution on the container.
  • In order to bring down the grid use the below command 
         docker-compose -f docker-compose.yml down







No comments:

Post a Comment