Applies to CrossBrowserTesting SaaS, last modified on January 19, 2022

For this document, we provide example test located in our Zalenium GitHub Repository.

Zalenium's main goal is to allow anyone to have a disposable and flexible Selenium Grid infrastructure. A Selenium Grid that scales up and down dynamically with this solution based on docker-selenium to run your tests is started in seconds. When you need a different browser, Zalenium is easily integrated with the CrossBrowserTesting platform, so you can perform tests on a wide variety of OS/Device/Browser combinations, all from one test.

Let's walk through getting setup

  1. Start by installing docker, a standalone container image that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.

  2. Use docker to pull selenium and zalenium using the commands:

    docker pull elgalu/selenium
    docker pull dosel/zalenium
  3. Start Zalenium with the command:

    export CBT_URL= ""
    docker run --rm -ti --name zalenium -p 4444:4444 \
    -v /tmp/videos:/home/seluser/videos \
    -v /var/run/docker.sock:/var/run/docker.sock \
    --privileged dosel/zalenium start --cbtEnabled true

  4. Navigate to http://localhost:4444/grid/dashboard to view your Zalenium Dashboard

  5. Create an empty file called /zalenium/test/ with the following content:


    import unittest
    from selenium import webdriver
    import requests, time
    import os

    class SeleniumCBT(unittest.TestCase):
    def setUp(self):
    caps = {}
    caps['name'] = 'Zalenium Test'
    caps['browserName'] = 'Chrome'
    caps['version'] = '72'
    caps['platform'] = 'Windows 10'
    caps['screenResolution'] = '1366x768'
    caps['record_video'] = 'true'

    self.driver = webdriver.Remote(
    desired_capabilities = caps,
    command_executor = "http://localhost:4444/wd/hub")

    except Exception as e:
    raise e

    def test_CBT(self):

    print("The title is ", self.driver.title)


    if __name__ == '__main__':

  6. Now you are ready to run your test using the command:

    Note: You will need to use your Username and Authkey to run your tests on CrossBrowserTesting To get yours, sign up for a free trial or purchase a plan.

Use the local connection

If you would like to test behind your firewall or access non-public sites, you can use our local connection tool through our Zalenium integration. Simply add the following parameter to your configuration:

--startTunnel true


As you can probably make out from our test, we visit a simple login page and display the title.

We kept it short and sweet for our purposes, but there is so much more you can do with Zalenium! Being built on top of Selenium means the sky is the limit as far as what you can do. If you have any questions or concerns, feel free to contact Support.

See Also

Test Frameworks and Tools

Highlight search results