filmov
tv
How to setup Selenium Grid in Docker | Using Docker Compose yml file | Part 1

Показать описание
In this video we are going to see that, how to setup selenium grid on docker.
We can setup the grid on docker with easy commands using docker-compose method.
To start with, first install the docker in your system based on your operating system.
###################################################
# Add the `-d` flag at the end for detached execution
version: "3"
services:
chrome:
image: selenium/node-chrome
volumes:
- /dev/shm:/dev/shm
depends_on:
- selenium-hub
environment:
- HUB_PORT_4444_TCP_ADDR=selenium-hub
- HUB_PORT_4444_TCP_PORT=4444
- NODE_MAX_INSTANCES=5
ports:
- "6900:5900"
firefox:
image: selenium/node-firefox
volumes:
- /dev/shm:/dev/shm
depends_on:
- selenium-hub
environment:
- HUB_PORT_4444_TCP_ADDR=selenium-hub
- HUB_PORT_4444_TCP_PORT=4444
- NODE_MAX_INSTANCES=3
ports:
- "6902:5900"
selenium-hub:
image: selenium/hub
container_name: selenium-hub
ports:
- "4444:4444"
####################################################
To setup the grid, open the command prompt and make sure that you are at the same directory where your docker-compose file is placed.
Run the below command in sequence
docker pull selenium/hub
docker pull selenium/node-chrome
docker pull selenium/node-firefox
Above commands will download the images from docker server.
Now run the below command to setup the grid.
docker-compose up -d
Now, if you go to the browser and type the url localhost:4444
Then you will see that selenium grid is running on the provided port and two nodes are attached with it, one for browser chrome and the other one for firefox.
In case you want to stop the selenium grid setup then you can do that by typing the below command.
docker-compose down
So this is how we can setup the selenium grid in docker.
***********Please comment in case of any query.***************
Also, please see other videos as well.
We can setup the grid on docker with easy commands using docker-compose method.
To start with, first install the docker in your system based on your operating system.
###################################################
# Add the `-d` flag at the end for detached execution
version: "3"
services:
chrome:
image: selenium/node-chrome
volumes:
- /dev/shm:/dev/shm
depends_on:
- selenium-hub
environment:
- HUB_PORT_4444_TCP_ADDR=selenium-hub
- HUB_PORT_4444_TCP_PORT=4444
- NODE_MAX_INSTANCES=5
ports:
- "6900:5900"
firefox:
image: selenium/node-firefox
volumes:
- /dev/shm:/dev/shm
depends_on:
- selenium-hub
environment:
- HUB_PORT_4444_TCP_ADDR=selenium-hub
- HUB_PORT_4444_TCP_PORT=4444
- NODE_MAX_INSTANCES=3
ports:
- "6902:5900"
selenium-hub:
image: selenium/hub
container_name: selenium-hub
ports:
- "4444:4444"
####################################################
To setup the grid, open the command prompt and make sure that you are at the same directory where your docker-compose file is placed.
Run the below command in sequence
docker pull selenium/hub
docker pull selenium/node-chrome
docker pull selenium/node-firefox
Above commands will download the images from docker server.
Now run the below command to setup the grid.
docker-compose up -d
Now, if you go to the browser and type the url localhost:4444
Then you will see that selenium grid is running on the provided port and two nodes are attached with it, one for browser chrome and the other one for firefox.
In case you want to stop the selenium grid setup then you can do that by typing the below command.
docker-compose down
So this is how we can setup the selenium grid in docker.
***********Please comment in case of any query.***************
Also, please see other videos as well.
Комментарии