Selenium Grid Setup with Docker Containers

 

Pull Docker Images

Pull Selenium-hub image using command

docker pull selenium/hub

Pull FireFox  image using command

docker pull selenium/node-firefox

Pull Chrome image using below command

docker pull selenium/node-chrome

 

Verify Images

docker images

  

Running Docker Containers by using below commands.


docker network create grid

 docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub

 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium/node-chrome

 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium/node-firefox


When you are done using the Grid, and the containers have exited, the network can be removed with the following command:

 

docker network rm grid      # Removes the grid network


Followers