3. Docker
Enterprise Application Container
3
Obvious advantages:
• 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 on Mac/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
• kill all 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 grid disadvantages
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 vs Selenoid
7
Features:
• Isolated environment
• Resources consumption and utilization
• Installation
• Support of multiple browser versions
• Focus
• User interface and logs
9. Selenoid
Resources consumption and utilization
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 Selenium Grid 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 multiple browser versions
11
• Several containers with the appropriate browsers are
to be built.
12. Selenoid
Focus
12
• Challenges may emerge 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 and logs
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.
15. Selenoid
Data storage in RAM
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 resolution types
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 of tests
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:
23. Selenoid
Run selenoid using cm 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/