Selenium Overview

Introduction

Testable supports executing Selenium tests in a globally distributed fashion using the following Selenium bindings:

  1. Webdriver.io (Node.js)
  2. Protractor (Node.js)
  3. Selenium Java
  4. Selenium Javascript (+ Mocha)
  5. Serenity BDD

There are also some specific instructions for testing OpenFin applications.

This document gives a general overview of how Testable integrates with Selenium.

How it Works

Each test runner exposes a Selenium endpoint and passes the URL for this as the SELENIUM_REMOTE_URL environment variable as well as setting it in the appropriate place depending on your Selenium bindings.

When you create a session, this test runner endpoint will receive the request and do the following:

  1. [Docker only] Launches an xvfb display for the session.
  2. Checks if the test runner already has the browser + version requested. If not it will install it before proceeding.
  3. Starts a local Selenium server or Chromedriver (for OpenFin) configured to use the driver corresponding to the browser + version requested.
  4. To collect network metrics (assuming enabled) it either launches Puppeteer to collect these metrics via CDP or a Browsermob proxy for Firefox.
  5. If video is enabled, starts recording the session. Each recording will be available live as part of your test results.
  6. When your test finishes all processes launched for this session will be terminated.

This means that if your test launches many sessions, each one will have a separate isolated environment which includes a separate video recording, commands, and screenshots. On the results you’ll see a toggle to switch between the sessions.

This share nothing approach allows for scaling massive load tests that simulate concurrent users across numerous test runners and regions by avoiding use of a shared, non-local Selenium grid that limits scalability.

The code that defines your scenario can be uploaded to Testable or downloaded at test time from a Git repository.

Parameters

Parameterize your scenario and reuse it across many test configurations or via API. This can be useful to control things like environment, base URL, credentials, etc. Parameter values are accessible in your Selenium scripts as environment variables. For example, parameter Abc is accessible as environment variable PARAM_ABC.

Read more about scenario parameters here.

Environment

Testable passes various environment variables into your test that give you context (e.g. region name, global index, total number of concurrent users, etc).

See our Selenium environment page for more details.