A custom Selenium-webdriver dedicated to being used with Astraload SaaS

Usage no npm install needed!

<script type="module">
  import astraloadAslWebdriver from 'https://cdn.skypack.dev/@astraload/asl-webdriver';



AslWebDriver is a custom Selenium-webdriver dedicated to being used with Astraload SaaS.


npm install @astraload/asl-webdriver


Download and place on your system PATH an executable of chromedriver corresponding to a version of the Chrome browser installed on your system.




  1. isHeadless (boolean): Flag whether to run chrome in headless mode. Defaults to false. Set to true in order to run load test on Astraload SaaS.
  2. windowSize ({ height (number), width (number)} optional): Browser window size.
  3. logLevel (number optional): Level of extended logging of network activity. Can be set to LogLevel.Verbose and/or LogLevel.Debug. LogLevel.Verbose flag enables logging of dataReceived network events. LogLevel.Debug flag enables logging of unfinished network requests. Use Bitwise OR operator to combine both flags.


const { AslWebDriver } = require('@astraload/asl-webdriver');

const aslWebDriver = new AslWebDriver({
  isHeadless: true,
  windowSize: {
    widht: 1280,
    height: 960,
  logLevel: AslWebDriver.LogLevel.Verbose | AslWebDriver.LogLevel.Debug,

loadBrowser() / async loadBrowserAsync()

Method takes no parameters. It loads Selenium WebDriver, wraps it for capturing performance data, and returns its instance.


There are 2 ways to integrate AslWebDriver with your tests, depending on whether you use async/await in your tests or not.

Using async/await:

let driver;

(async function() {
  try {
    driver = await aslWebDriver.loadBrowserAsync();
    await driver.get(url);
    await driver.wait(until.titleContains('SomeTitle'), timeout);
    await driver.quit();
  } catch (error) {
    await aslWebDriver.handleTestFail(error);

    // you need to call handleTestFail method to let the agent properly handle failed test,
    // otherwise the agent will considers this test as successfully passed.
    // handleTestFail method will automatically quit the browser after handling the failed test.

WITHOUT using async/await:

const driver = aslWebDriver.loadBrowser();
driver.wait(until.titleContains('SomeTitle'), timeout);

// if error happens during the test execution
// AslWebDriver will catch it for you, properly handle it
// and then quit the browser.

async handleTestFail(error)

Method takes a single parameter - an error object. Method is intended to be used in tests which are written is async/await manner to let agent properly handle failed test. Method automatically closes the browser after handling failed test.


(async function() {
  try {
    // your test steps
    // ...
  } catch (error) {
    await aslWebDriver.handleTestFail(error);

userId (number). Let's say you run a test for 100 users. In that case, each aslWebDriver instance will have its own unique userId which is a user index in a range from 0 to 99.


const { AslWebDriver } = require('@astraload/asl-webdriver');
const aslWebDriver = new AslWebDriver();
const { userId } = AslWebDriver;


The @astraload/asl-webdriver package mirrors all the exports of the selenium-webdriver package; so if you need to import anything from the selenium-webdriver package to use in your load test, import it from @astraload/asl-webdriver package instead:

const { AslWebDriver, By, Condition, until } = require("@astraload/asl-webdriver");