1) Create a file docker-compose.yaml with Required config
docker-compose.yaml
version: '3'
services:
selenium-hub:
image: selenium/hub
ports:
- "4442-4444:4442-4444"
networks:
- grid
node-chrome:
image: selenium/node-chrome
environment:
- SE_EVENT_BUS_HOST=selenium-hub
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
networks:
- grid
node-firefox:
image: selenium/node-firefox
environment:
- SE_EVENT_BUS_HOST=selenium-hub
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
networks:
- grid
networks:
grid:
driver: bridge
2) Run docker-compose.yaml
docker-compose up
3) To check hub
& nodes running state:
http://localhost:4444/grid/console
4) To increase
number of nodes:
docker-compose
scale chrome=3
5) To stop the
grid and cleanup the created containers, run
docker-compose down