Zalenium - A Disposable and Flexible Selenium Grid Infrastructure

Engineering Productivity is an area in Zalando where our main goal is to help other teams test their products by providing great tools and services. For UI testing execution, we offer teams a mix of internal and external tools. Some teams use docker-selenium, a dockerized Selenium Grid created by our colleague Leo Gallucci, and other teams use Sauce Labs.

Each tool has its own advantages and disadvantages, but they fulfill our needs and complement each other. We thought it would be a great idea to mix them, so we can run tests quickly in Chrome/Firefox, and when we need other browsers, use Sauce Labs. Chrome and Firefox are the most used browsers for testing at Zalando, while Safari and IE/Edge come afterwards.

We decided to create Zalenium, a tool to help you scale your local grid dynamically with Docker containers. It uses docker-selenium to run your tests in Firefox and Chrome locally, and when you need a different browser, your tests get redirected to a cloud testing provider.

We know how complicated it is to have a stable Selenium Grid with enough capabilities to cover all browsers and platforms, and how hard it can be to maintain it over time. With this approach, you can run your UI tests faster with Firefox and Chrome due to the fact that they are running on a local grid, on a node created from scratch and disposed of after the test finishes. Whenever you need a capability that cannot be fulfilled by docker-selenium, the test gets redirected to a cloud testing provider like Sauce Labs.

This highlights Zalenium's main goal: to allow anyone to have a disposable and flexible Selenium Grid infrastructure.This image shows you how Zalenium works conceptually:

After running your tests, you will notice that videos are recorded if you check your local “tmp/videos” folder. You can also see the tests running in the live preview feature. Check out further startup options here (like screen sizes, using different time zones, etc.).

With Zalenium, we are giving teams the opportunity to use their resources in a more efficient way. By combining Zalenium and Sauce Labs, teams can run UI tests during development much faster, and before releasing they can do a final check using the additional capabilities provided by Sauce Labs. With this integration, our test suites operate with greater speed, since most of the tests run on local Firefox/Chrome nodes, and we use the cloud testing service we pay for in a smarter way.

Zalenium is open source, so please feel free to try it and use it as part of your infrastructure. Do not hesitate to create an issue asking for help or suggest features, or contribute in any way you would like.

Stay tuned for upcoming features by giving us a star and watching the project on GitHub. Contact us on Twitter for further questions at @diegofmolina and @elgalu.