zalenium

Managing Selenium Node using Zalenium

Introduction

Previously, we discussed ways to manage Selenium Grid and nodes manually and using servlets. While both solutions can be quickly implemented, they should not be considered as scalable and long term solutions. Zalenium is a new tool which leverages Docker to quickly provision nodes and allow video inspections as bonus. It does not involve big learning curve (although you do need to know Docker) and can be used out of the box for most situation.

Problem

How could a tester manage Selenium Node using Zalenium?

Solution

Zalenium’s setup is fairly simple. First of all ensure you have installed Docker. Zalenium and its dependencies are using Docker images so some pulling will be required.

  1. Run this docker command to pull docker/selenium image. This image enable Firefox and Chrome browsers for zalenium.
    docker pull elgalu/selenium
  2. Run this docker command to pull zalenium image.
    docker pull dosel/zalenium
  3. Run this docker command to start zalenium image. This command also save recorded videos to your local drive (modify ‘/tmp/videos’ accordingly).
    docker run --rm -ti --name zalenium -p 4444:4444 
        -v /var/run/docker.sock:/var/run/docker.sock 
        -v /tmp/videos:/home/seluser/videos 
        --privileged dosel/zalenium start

     

After zalenium is successfully started, go to http://localhost:4444/grid/console to see the Grid console. Zalenium provision additional nodes on demand, ie additional node is only provisioned when it received a desired platform/browser request.

Using the above settings, zalenium is able to provision Firefox and Chrome browsers. For further scalability, Zalenium allows provisioning of nodes in cloud providers such as SauceLabs and BrowserStack providing you have respective account. This allows testing in more diverse combination of platform and browser. More information on this integration can be found here.

Another advantage of Zalenium is it provides ability to preview currently running tests and ability to record test run. The preview can be accessed in http://localhost:4444/grid/admin/live and the recorded videos can be accessed in http://localhost:4444/dashboard.

Conclusion

Zalenium is the most practical solution to manage and scale Selenium Grid in effective manner. The setup is relatively simple and can be used out of the box. More information on zalenium can be seen here.

 

Leave a Reply

Your email address will not be published. Required fields are marked *