Selenium Grid is a widely spread solution used by test automation engineers. It serves to obtain a distributed environment for parallel execution of multiple tests. However, QA engineers encounter bottlenecks, which can be solved using an open source project named Selenoid.
This article will figure out how Selenoid can help you save time and streamline automated tests performance, as well as provide a high-quality solution at short notice.
What Is Peculiar About Selenium Grid?
Selenium Grid is a cluster consisting of several Selenium servers. It’s intended to create a distributed network for a simultaneous launch of tests in multiple browsers. It incorporates a central server (hub) and nodes connected to it.
Although the solution is of high demand, the following peculiarities should be taken into account:
- Time-consuming deployment process
Engineers have to fulfill the following steps in order to deploy Selenium Grid:
- Install Java Development Kit
- Download Selenium Server JAR latest version
- Download Web driver required versions
- Unzip Web driver
- Install the required versions of browsers
- Input long commands.
- Complex launch commands
The commands to initiate server and node launch look as follows:
- Performance speed reduction
The hub decelerates if multiple browsers are run in different nodes.
- Compatibility issue
Browser and node versions should be compatible to avoid conflicts.
Is There a Solution?
Some issues, such as long deployment process, can be optimized by means of Docker. This software platform is developed for a quick application build, debugging and deployment.
Engineers elaborate the image and after that proceed with the implementation of a container. It covers all aspects necessary for the application performance: libraries, system tools, code, and execution environment.
Even official Selenium images with multiple browser versions will hardly optimize browser launch since all Selenium Grid peculiarities remain constant.
Selenoid as an Alternative
Quickly and easily customizable Selenoid can become a robust option. This tool helps to run browsers in Docker containers. The process is different, although.
Selenoid launches a new container for each new browser request and stops it after the session is closed.
A certain browser version, the required version of the web driver or Selenium-server, which supports this browser and all necessary dependencies (for instance, graphics libraries) form each container.
All browser processes are fully isolated. This allows launching an unhindered number of multiple browser versions concurrently.
Selenoid is written in programming language Golang and supports all popular browsers.
Do you want to make life of your team easier? Consider test automation. It will come as a relief to both Dev and QA teams.
Selenoid vs. Selenium Grid
Both solutions pursue one objective, which is the elaboration of a single environment for a parallel launch of automated tests. However, these solutions differ a lot.
- Isolated environment
Selenoid allows running each browser in a separate container, which enables full isolation of the browser environment.
Whereas browser settings in Selenium Grid can be changed inadvertently.
Multiple nodes in Selenium Grid can provoke a full stop of tests’ execution, while Selenoid environment does not affect qualitative and continuous testing.
- Resources consumption and utilization
Since the Selenium Server is written in Java, the resources consumption under heavy load increases significantly.
Selenoid enables to maintain a high load without additional waste of resources.
On average, during 10 running sessions Selenium Server consumes 500 MB of RAM, while the rate of Selenoid is only 50-60 MB.
In addition, all inactive containers are removed at the end of each session. Thus, the level of free memory is always appropriate.
Unlike Selenium Grid deployment process, the one of Selenoid requires little time and effort. It presupposes Docker installation and the input of one command.
- Simultaneous support of multiple browser versions
This option is only available if you use Selenoid. Several containers with the appropriate browsers are to be built.
Challenges may emerge if multiple browsers are run on the same machine within Selenium Grid.
Due to the OS-specific nature, the focus can contain only one window. Therefore, windows can compete for it.
Selenoid allows running each test in a separate container. Thus, this problem is eliminated.
- User interface and logs
It’s challenging to obtain logs for certain browser sessions in terms of Selenium Grid. On the contrary, all available logs are accessed easily in Selenoid.
There is also the possibility of integration with the ELK stack for faster collection and analysis of current log files.
Selenoid is convenient to use due to the informative interface.
Selenoid Advanced Features
Selenoid comprises a number of additional functions that contribute to the workflow optimization.
- Data storage in RAM
Selenoid stores all temporary files in tmpfs.
Tmpfs is a temporary file repository that allows storing files in RAM, access to which is performed much faster than to the file system of the hard drive.
- Various screen resolution types
QA engineers can configure the appropriate screen resolution for a running container on their own by setting the required parameters in the Browser Capabilities.
- Browser screen display
Selenoid enables engineers to connect to the VNC port during tests execution and access the screen of the desired browser. It’s even possible to interfere in the process of running the automated test using the mouse.
- Video recording of tests
It’s possible to record the video of the tests performed.
For instance, the activation in the Google Chrome browser is implemented by setting the parameter true in the Browser Capabilities:
ChromeOptions options = new ChromeOptions ();
options.setCapability (“enableVideo”, true);
Due to multiple benefits, Selenoid is a robust solution for test automation engineers.
This scalable alternative helps to change configuration settings seamlessly according to the preferences and needs of your team, cut corners on resource consumption, and perform tests in due course.
Any questions left? Feel free to drop a line in the comments.