The document discusses Docker and Selenoid, with Docker being a tool to run applications in isolated containers and Selenoid being a tool for running Selenium tests in isolated Docker containers. Selenoid provides benefits over Selenium Grid like better resource usage, easier installation, and support for running each test in a separate container. The document also provides instructions for installing and running Selenoid using Docker or without Docker on different operating systems.
Overview of Docker advantages, installation on Mac/Windows, and essential commands for managing containers.
Comparison of Selenium Grid's deployment challenges and performance issues with the advantages of Selenoid in terms of isolation, resource consumption, and user interface.
Selenoid's advanced features including RAM data storage, configurable screen resolution, browser access, and video recording capabilities.
Details on Selenoid ecosystem, configuration management, UI features, and instructions for running Selenoid with and without Docker.
Open floor for questions and discussions regarding Docker and Selenoid usage.
Docker
Enterprise Application Container
3
Obviousadvantages:
• Convenient application
encapsulation..
• Understandable monitoring. .
• Work with Linux, MacOs,
Windows.
Terminology
Docker is used to run software packages called containers. Containers are isolated from
each other and bundle their own application, tools, libraries and configuration files.
Containers are an abstraction at the app layer that packages code and dependencies
together. Containers take up less space than VMs (container images are typically tens of
MBs in size), can handle more applications and require fewer VMs and Operating
systems.
An instance of an image is called a container. You have an image, which is a set of
layers as you describe. If you start this image, you will have a running container of this
image. You can have many running containers of the same image.
4.
Docker
Install docker onMac/Windows
4
Additional info :
• Advanced (CPUs: 3, Memory:
2048 MB, Swap: 2048 MB)
• Daemon (Experimental
features checkbox unmarked)
.
• *Shared Drives (Drive C should
be shared - checkbox marked)
Install latest Docker for Windows
https://hub.docker.com/editions/community/docker-ce-desktop-
windows
Install latest Docker for Mac
https://hub.docker.com/editions/community/docker-ce-desktop-mac
unzip latest Kitematic to ./Docker/Kitematic folder
5.
Docker
Additional commands:
5
• killall running containers with docker kill $(docker ps -q)
• delete all stopped containers with docker rm $(docker ps -a -q)
• delete all images with docker rmi $(docker images -q)
6.
Selenium grid
Selenium griddisadvantages
6
Time-consuming deployment process
1.Install Java Development Kit
2.Download Selenium Server JAR latest version
3.Download Web driver required versions
4.Unzip Web driver
5.Install the required versions of browsers
6.Input long commands.
Performance speed reduction
The hub decelerates if multiple browsers are run in
different nodes.
Complex launch commands
7.
Selenoid
Selenium server/grid vsSelenoid
7
Features:
• Isolated environment
• Resources consumption and utilization
• Installation
• Support of multiple browser versions
• Focus
• User interface and logs
Selenoid
Resources consumption andutilization
9
• 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.
10.
Selenoid
Installation
10
• Unlike SeleniumGrid deployment process, the one of
Selenoid requires little time and effort. It presupposes
Docker installation and the input of one command.
11.
Selenoid
Support of multiplebrowser versions
11
• Several containers with the appropriate browsers are
to be built.
12.
Selenoid
Focus
12
• Challenges mayemerge if multiple browsers are run
on the same machine within Selenium Grid.
• Selenoid allows running each test in a separate
container. Thus, this problem is eliminated.
13.
Selenoid
User interface andlogs
13
• 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.
• Selenoid is convenient to use due to the informative
interface.
Selenoid
Data storage inRAM
15
• 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.
16.
Selenoid
Various screen resolutiontypes
16
• QA engineers can configure the appropriate screen
resolution for a running container on their own by
setting the required parameters in the Browser
Capabilities.
17.
Selenoid
Browser screen display
17
•Selenoid enables engineers to connect to the Virtual
Network Computing port during tests execution and
access the screen of the desired browser.
18.
Selenoid
Video recording oftests
18
• 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:
Selenoid
Run selenoid usingcm with docker
23
On Linux and Mac OS:
curl -s https://aerokube.com/cm/bash | bash && ./cm selenoid start --vnc --last-
versions 1 --browsers chrome && ./cm selenoid-ui start
On Windows
just download the latest binary with your browser from releases page for windows (386
and amd64 binaries available). Then type:
./cm.exe selenoid start --vnc --last-versions 1 --browsers chrome
./cm.exe selenoid-ui start
Set up desired capabilities:
DesiredCapabilities cap = new DesiredCapabilities();
capabilities.setBrowserName("chrome");
capabilities.setVersion("");
capabilities.setCapability("enableVNC", true);
capabilities.setCapability("enableVideo", true);
capabilities.setCapability("enableLog", true);
capabilities.setCapability("videoName", “video.mp4");
capabilities.setCapability("logName", “log.log");
Webdriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub/"),
capabilities);
https://aerokube.com/cm/latest/