In previous tutorial, we have discussed about the features of Selenium and deprecated functions. Now I this tutorial we will understand about the enhanced Selenium Grid in Selenium 4.
- Introduction to Grid
- Features Changes in Grid
- Mode of deployment
- How it is working
- Graph QL
- Expectation from Selenium 4
Introduction to Grid
Before going into deep of Enhanced Selenium Grid, let’s understadn what is Grid actually. Originally Selenium Grid was developed in 2011. With Selenium Grid we can set up our infrastructure different browsers on the different System or machine. The component Selenium Grid supports the process in which we can run our script in different OS and browser simultaneously in a stipulated time. You can run the test cases parallel in multiple environment and multiple platforms.
Features Changes in Selenium Grid 4
Previous version of Selenium Grid was very complex to setup and work with the Node and Hub. Selenium 4 makes it very simple and crispy by adding the Docker support in it.
This is very much light and smooth as the startup and setup of Node and Hub is not required separately in Selenium Grid 4. It has very much enhanced & User-Friendly GUI which leads to easy to work with Selenium Grid. Addition to User friendly I also support the tools like Azure, AWS, GCP and many more.
In Docker support, it will be used to spin the container in Docker without any heavy Virtual Machine. Though Selenium 4 Grid is implemented with Docker support, we can deploy our grid on Kubernetes for better scaling.
With Kubernetes, we will set up the grid machine. The advantage of this is Docker and Kubernetes can scale by using cloud machine.
The configuration file of Grid 4 generally helps to spin up the Instances of Grid. The Instances of Grid is written in TOML which is known as TOM’s Obvious, minimal Language. This is very simple and very easy to understand.
Mode of deployment
We can deploy the Grid in 3 mode generally.
- Standalone Mode
- Hub and Node
- Fully Distributed
Earlier version of Selenium Grid only supports IPV4 addresses. It does not supports IPV6 addresses. If you want to learn about the IPV4 and IPV6 address then you can go to my Network Protocol tutorial to learn more on IPV4 and IPV6 address.
But in Selenium 4 Grid, addition to IPV4, IPV6 address also supported. We can communicate t HTTPS protocol directly by using this version.
Selenium 4 Grid communicates HTTPS with support for TLS connection.
In Selenium 4 Grid, Hub and Node both comes in a single jar file When we start the server, both Node and Hub started. The pervious release of Selenium Grid supports only below process
- Session Map
- Distributed Process
But now in current version 4, it support another process addition to previous called Node.
- Session Map
- Distributed Process
Now Let’s understand what all the components will do.
- Router : Router is the component which listen a request.
- Distributor : Distributor is the component which accept the request consist od list of session node and select a node which will be used to run a test case.
- Session Map : Session Map is the component which will map the session ID to a Node.
- Node : Node is nothing but a machine which is responsible for execution of Test Script.
Selenium 4 Grid eliminates the installation process. It also allows to execute out Test Case in parallel mode on multiple number of Browsers / System / Operating System. Also there is no chance of issue on Thread safety.
How it is working?
We have understood what all the components are involved in Selenium 4 Grid. Now let’s have a look on how it is working.
- Initially a message request should be raised by a computer. After sending request will come to router and ping to Grid.
- After it pings to Grid a new session request will transfer to Distributor. This session request should contain a list of current nodes.
- After receiving a session request consist of list of nodes, it is the responsible of Distributor to select the node to be running in the system.
- When the Distributor selected a node to run the test case then a session will start with that node. After Session start the responsibility will come to node. Session Map will map the session Id to the Node.
- Once session start it is a node’s responsibility to respond back to the Distributor with the session app URL and returns the control for use.
This Architecture process is new in Selenium 4. But this is little bit similar to Selenium 2. Selenium 4 and Selenium 2 have the same process, but Selenium 4 separated this process as in Selenium 2 Hub classifies the Router, Distributor and Session Map.
Observability is the responsible for measuring the System Internal State trace. It track the process when an API is called / invoked, or a session created. This is very useful feature which is added in Selenium 4. This can help the Admin of the test or system to track the log of error and issue. Also by debugging they can find the root cause of the process or issue or failure and that can be fixed easily in less time.
Telemetry is the new framework which is added in Selenium 4 Grid. It helps us to perform distributed tracing. We can hook into anything with the telemetry framework if something will be going wrong while running the test cases.
With Telemetry, we can track on the process of Grid if something fails and can figure it out to fix that issue. This feature is working like a log in Selenium.
Graph QL is nothing but a console for Front End. Through Front End Console, we can execute the Graph QL query against the selenium Grid. It can be performed either in your local machine or in distributed system.
What are expected to be coming in Selenium 4 Grid Stable Version?
Now we have discussed everything about the features which are available in Current version of selenium 4. But this is not the stable version. Stable version of selenium 4 still need to be published.
So what others can be expected in stable version? This is just and expected but not confirmed.
- Revised version of Grid UI
- Graph QL for Querying
- Improvement on the stability and resistance
- Selenium 4 makes Grid very simple and crispy by adding the Docker support in it.
- In Selenium 4 Grid, Hub and Node both comes in a single jar file When we start the server, both Node and Hub started.
- Observability is the responsible for measuring the System Internal State trace.
- Telemetry is the new framework which is added in Selenium 4 Grid. It helps us to perform distributed tracing.
- Graph QL is nothing but a console for Front End. Through Front End Console, we can execute the Graph QL query against the selenium Grid.
- Selenium 4 Grid eliminates the installation process. It also allows to execute out Test Case in parallel mode on multiple number of Browsers / System / Operating System. Also there is no chance of issue on Thread safety.
Now we have cleared about the Enhanced Selenium Grid features in Selenium 4. In next Tutorial we will understand the Upgraded Selenium IDE in Selenium 4 version.