Configure Selenium Grid using Docker
What are Hub and Nodes?
Basically, we have a Hub which is a server that we connect from our tests and we have Nodes, they can be on different machines and they register with the hub. Simply, we have a hub and several nodes, nodes are registered our hub and hub knows that which browsers are available. Hub sends requests to the nodes based on desired capabilities and executes the tests.
There are 2 approaches to create hub and node environment
- Distribution of Server(hub) and Client(node) environment physically or on VM
- Create Docker environment seamlessly using docker images
Refer my blog for approach 1
Approach 2 is the latest concept and overcome the problem in setting up required browsers / OS combinations across these virtual machines.
Docker is a lightweight container which can make you run distributed applications in a minute. Docker Containers take up less space than VMs (container images are typically tens of MBs in size and start almost instantly.
Once docker is installed and running on the server have a very easy solution to create up required hub and server environment on docker using ".yml" file
Refer my blog how Configure Selenium Grid using Docker
Here I would like to add some interesting things to register debug node
So you will connect your docker with VNC and see browser up and runing in docker
Here you can see node-chrome-debug is expose vnc port 32769 and connect with docker port 5900 and node-chrome-debug is expose vnc port 32768 and connect with docker port 5900
Now two VNC viewer instance and connect both debug dockers
After connecting to VNC
Run the Grid script and see how browser is opening in chrome docker successfully
Samir Patel, deploying selenium grid on dockerized environment is great. Are there enough containerised environment available for Windows ? How do we setup a hybrid grid composed of both windows and Linux / Ubuntu based environment ? Overall looking good approach to move with. Good article. Keep it up dear.