Selenoid is an open source project written in golang and active maintainers are Alexander Andryashin, Ivan Krutov, and Kirill Merkushev. In the previous article, I tried to explain the usage of docker-selenium and the advantages of it over Selenium Grid. Now, I will explain another containerization solution to run selenium tests in parallel and show you the advantages of it over docker-selenium.
It describes itself as;
I think the most exciting feature of the solenoid is to provide a fresh environment for each test.
When the test starts, the required container is created, the test is executed and the container is removed.
If you were using docker-selenium instead, same containers are used for all suite during the test and this may cause flaky or inconsistent results which are the most dangerous enemy of automation testing I think.
First of all, you need to install docker on your machine. You can follow the official documentation for installation. There are mainly three configurations exist.
You can download cm in non-gui Linux environment with below code snippet:
LATEST_BINARY_URL=`curl -s \
https://api.github.com/repos/aerokube/cm/releases/latest | \
grep "browser_download_url" | grep linux | cut -d : -f 2,3 | tr -d \"`
curl -L -o cm $LATEST_BINARY_URL
chmod +x ./cm
Note: Chrome images use “/” instead of “/wd/hub” in browser.json
You can run selenoid in a docker container or as a standalone binary.
When we run the start command, cm first checked the existence of docker. It found docker and downloaded required docker images. If docker was not installed, standalone binary would be downloaded.
Our setup is ready but there is no user interface.
Aerokube has another open source project called selenoid-ui. This is a nice user interface to track what’s happening during the test execution. Again, you can use cm to start selenoid-ui.
Alternatively, you can download selenoid-ui binary, give execution permission and execute it.
If everything goes ok, you should see this: