Skip to main content

Selenium Test Options

This page offers an overview of all the various options you can specify when starting an automated Selenium test.

The Selenium-Specific Settings are required to run automated Selenium tests: browserName, browserVersion and platformName.

The other options are TestingBot Options, these allow you to customize your test in terms of specific driver versions, privacy options, platform options and more.

The Selenium Capabilities generator allows you to easily generate the necessary capabilities for your tests.

Required Selenium Settings

Browser Name

The name of the browser to run your automated test on. Please see our list of browsers that we support.

The browserName is a required capability. With Selenium 4, the browser's Options class (for example ChromeOptions) sets it for you.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}

Browser Version

The version of the browser to run your automated test on. Please see our list of browsers + versions that we support.

Set it with the W3C browserVersion capability. If you leave it out, TestingBot uses the latest version.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Other Options:
  • "browserVersion": "*" : If you use * as version, TestingBot will pick a random version.
  • "browserVersion": "latest" : TestingBot will automatically take the latest version. You can also use latest-1, latest-2, ... to test on the next most recent versions. For example, if the current latest Firefox version is 81 and you use latest-2, then the test will run on Firefox 79.
  • "browserVersion": "<=16" : TestingBot will pick a version smaller than or equal to the version you specify with <=.
    "browserVersion": "16>=" : TestingBot will pick a version higher than or equal to the version you specify with >=.

Platform

Indicates on which operating system the test should run. Please see a list of platforms that we currently support.

The platformName is a required capability, for example WIN11.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}

Device Name

When running a mobile automated test, you'll need to specify on which mobile device (or simulator/emulator) you want to test.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'Android'
options.add_option('appium:deviceName', 'Pixel 9')
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("Android");
options.setCapability("appium:deviceName", "Pixel 9");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'Android');
$caps->setCapability('appium:deviceName', 'Pixel 9');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "Android"
options.set_capability("appium:deviceName", "Pixel 9")
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      platformName: 'Android',
      'appium:deviceName': 'Pixel 9',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "Android"
};
options.AddAdditionalOption("appium:deviceName", "Pixel 9");
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}

We offer regex/wildcard parameters which you can use to allocate a device:

Regex Input Result
"iPhone.*" This will allocate any available iPhone device (phone)
".*Galaxy.*" This will allocate any of the available Galaxy devices (phone or tablet)
"*" This will allocate a random available device, either iOS or Android device
"iPhone [8-11]" This will allocate either an iPhone 8 or 11
"iPhone 6.*" This will allocate either an iPhone 6 or 6S

Some Examples:

// find any iPhone, except 6 or 6s
capabilities.setCapability("appium:deviceName", "^iPhone(?!\\s?6S?\\b).*$");

// find any device which name starts with Galaxy
capabilities.setCapability("appium:deviceName", "Galaxy.*");

Device Version

You can specify the version of the device you want to target. You can use a regex/wildcard pattern here too, to target a broad range of versions. On real devices this significantly lowers the chance of hitting an occupied device.

Instead of only targeting a specific iOS or Android device, you can target a wider range of devices.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'Android'
options.add_option('appium:deviceName', 'Galaxy.*')
options.add_option('appium:platformVersion', '(14|15).*')
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("Android");
options.setCapability("appium:deviceName", "Galaxy.*");
options.setCapability("appium:platformVersion", "(14|15).*");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'Android');
$caps->setCapability('appium:deviceName', 'Galaxy.*');
$caps->setCapability('appium:platformVersion', '(14|15).*');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "Android"
options.set_capability("appium:deviceName", "Galaxy.*")
options.set_capability("appium:platformVersion", "(14|15).*")
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      platformName: 'Android',
      'appium:deviceName': 'Galaxy.*',
      'appium:platformVersion': '(14|15).*',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "Android"
};
options.AddAdditionalOption("appium:deviceName", "Galaxy.*");
options.AddAdditionalOption("appium:platformVersion", "(14|15).*");
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}

Some Examples:

// target multiple specific versions of an iPhone device
capabilities.setCapability("appium:deviceName", "iPhone.*");
capabilities.setCapability("appium:version", "15.0|14.2|14|13.4|13.3");

// find any Galaxy device with Android version 13 or 14
capabilities.setCapability("appium:deviceName", "Galaxy.*");
capabilities.setCapability("appium:version", "(13|14).*");

Tablet Only

You can specify this capability when you only want to allocate a tablet device.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'Android'
options.add_option('appium:deviceName', '*')
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'tabletOnly' => true
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("Android");
options.setCapability("appium:deviceName", "*");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("tabletOnly", true);
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'Android');
$caps->setCapability('appium:deviceName', '*');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'tabletOnly' => true
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "Android"
options.set_capability("appium:deviceName", "*")
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "tabletOnly": True
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      platformName: 'Android',
      'appium:deviceName': '*',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        tabletOnly: true
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "Android"
};
options.AddAdditionalOption("appium:deviceName", "*");
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["tabletOnly"] = true
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}

Phone Only

You can specify this capability when you only want to allocate a phone device.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'Android'
options.add_option('appium:deviceName', '*')
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'phoneOnly' => true
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("Android");
options.setCapability("appium:deviceName", "*");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("phoneOnly", true);
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'Android');
$caps->setCapability('appium:deviceName', '*');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'phoneOnly' => true
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "Android"
options.set_capability("appium:deviceName", "*")
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "phoneOnly": True
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      platformName: 'Android',
      'appium:deviceName': '*',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        phoneOnly: true
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "Android"
};
options.AddAdditionalOption("appium:deviceName", "*");
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["phoneOnly"] = true
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}

Use a specific version of Selenium

By default we use Selenium version 2.53.1 to run your test.
If you wish to use another Selenium version for your test, please specify one of the following available versions:

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'selenium-version' => '4.36.0'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("selenium-version", "4.36.0");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'selenium-version' => '4.36.0'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "selenium-version": "4.36.0"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        'selenium-version': '4.36.0'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["selenium-version"] = "4.36.0"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value Possible Values:
string "2.53.1"
4.49.0
4.48.0
4.47.0
4.46.0
4.45.0
4.44.0
4.43.0
4.42.0
4.41.0
4.40.0
4.39.0
4.38.0
4.37.0
4.36.0
4.35.0
4.34.0
4.33.0
4.32.0
4.31.0
4.30.0
4.29.0
4.28.1
4.28.0
4.27.0
4.26.0
4.25.0
4.24.0
4.23.1
4.23.0
4.22.0
4.21.0
4.20.0
4.19.0
4.18.1
4.18.0
4.17.0
4.16.1
4.16.0
4.15.0
4.14.1
4.14.0
4.13.0
4.12.1
4.12.0
4.11.0
4.10.0
4.9.0
4.8.3
4.8.2
4.8.1
4.8.0
4.7.0
4.6.0
4.5.3
4.5.2
4.5.1
4.5.0
4.4.0
4.3.0
4.2.2
4.2.1
4.2.0
4.1.3
4.1.2
4.1.1
4.1.0
4.0.0
4.0.0-beta-4
4.0.0-beta-3
4.0.0-beta-2
4.0.0-beta-1
4.0.0-alpha-7
4.0.0-alpha-6
3.141.59
3.141.5
3.141.0
3.14.0
3.13.0
3.12.0
3.11.0
3.10.0
3.9.0
3.8.1
3.8.0
3.7.1
3.7.0
3.6.0
3.5.3
3.5.2
3.5.1
3.5.0
3.4.0
3.3.1
3.3.0
3.2.0
3.1.0
3.0.1
2.53.1
2.53.0
2.52.0
2.51.0
2.50.0
2.49.0
2.48.2
2.48.1
2.48.0

Chromedriver

We support using custom ChromeDriver versions during your tests. By default the most recent Chromedriver is used according to the version of Chrome you're testing on.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = '148'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'chromedriverVersion' => '148.0.7778.40'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("148");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("chromedriverVersion", "148.0.7778.40");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', '148');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'chromedriverVersion' => '148.0.7778.40'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "148"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "chromedriverVersion": "148.0.7778.40"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: '148',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        chromedriverVersion: '148.0.7778.40'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "148"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["chromedriverVersion"] = "148.0.7778.40"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value Possible Values:
string "2.46"
dev
149.0.7795.2
148.0.7778.40
147.0.7727.3
146.0.7680.0
145.0.7632.76
145.0.7561.2
144.0.7559.3
143.0.7499.40
142.0.7444.59
141.0.7390.54
140.0.7339.80
139.0.7207.2
138.0.7153.0
137.0.7117.2
136.0.7064.0
135.0.6999.2
134.0.6958.2
133.0.6943.16
132.0.6811.2
131.0.6778.3
130.0.6669.2
129.0.6614.3
128.0.6613.18
127.0.6533.88
127.0.6485.0
126.0.6423.2
125.0.6422.4
124.0.6367.60
124.0.6356.2
123.0.6262.5
122.0.6253.3
121.0.6154.0
121.0.6129.0
120.0.6099.5
119.0.6045.9
118.0.5979.0
117.0.5938.0
116.0.5845.82
115.0.5790.170
115.0.5790.90
114.0.5735.90
114.0.5735.16
113.0.5672.63
113.0.5672.24
112.0.5615.49
112.0.5615.28
111.0.5563.64
111.0.5563.41
111.0.5563.19
110.0.5481.77
110.0.5481.30
109.0.5414.74
109.0.5414.25
108.0.5359.71
108.0.5359.22
107.0.5304.62
107.0.5304.18
106.0.5249.61
106.0.5249.21
105.0.5195.52
105.0.5195.19
104.0.5112.79
104.0.5112.29
104.0.5112.20
103.0.5060.134
103.0.5060.24
102.0.5005.61
102.0.5005.27
101.0.4951.41
101.0.4951.15
100.0.4896.60
100.0.4896.20
99.0.4844.51
99.0.4844.35
99.0.4844.17
98.0.4758.80
98.0.4758.48
97.0.4692.71
97.0.4692.36
97.0.4692.20
96.0.4664.45
95.0.4638.10
94.0.4606.41
93.0.4577.15
92.0.4515.43
91.0.4472.101
91.0.4472.19
90.0.4430.24
89.0.4389.23
88.0.4324.96
88.0.4324.27
87.0.4280.88
87.0.4280.20
86.0.4240.22
85.0.4183.87
85.0.4183.83
85.0.4183.38
84.0.4147.30
83.0.4103.39
83.0.4103.14
81.0.4044.69
81.0.4044.20
80.0.3987.16
79.0.3945.36
79.0.3945.16
78.0.3904.70
78.0.3904.11
77.0.3865.40
77.0.3865.10
76.0.3809.68
76.0.3809.25
76.0.3809.12
75.0.3770.140
75.0.3770.90
75.0.3770.8
74.0.3729.6
73.0.3683.68
73.0.3683.20
72.0.3626.7
72.0.3626.69
71.0.3578.80
71.0.3578.33
71.0.3578.30
71.0.3578.137
70.0.3538.97
70.0.3538.67
70.0.3538.16
2.46
2.45
2.44
2.43
2.42
2.41
2.40
2.39
2.38
2.37
2.36
2.35
2.34
2.33
2.32
2.31
2.30
2.29
2.28
2.27
2.26
2.25
2.24
2.23
2.22
2.21
2.20
2.19
2.16
2.15
2.14
2.13
2.12
2.10

Internet Explorer Driver (IEDriver)

We provide both 32-bit and 64-bit versions of the Internet Explorer driver. By default we use the 2.53.1 (32-bit) IEDriver for your tests.
We use 32-bit because of a slow text entry bug with the 64-bit version.

For our screenshots, we use the 64-bit version, because of a screenshot problem with the 32-bit version.

require 'selenium-webdriver'

options = Selenium::WebDriver::IE::Options.new
options.platform_name = 'WIN10'
options.browser_version = '11'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'iedriverVersion' => '4.14.0'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
InternetExplorerOptions options = new InternetExplorerOptions();
options.setPlatformName("WIN10");
options.setBrowserVersion("11");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("iedriverVersion", "4.14.0");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::internetExplorer();
$caps->setCapability('platformName', 'WIN10');
$caps->setCapability('browserVersion', '11');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'iedriverVersion' => '4.14.0'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.ie.options import Options as IeOptions

options = IeOptions()
options.platform_name = "WIN10"
options.browser_version = "11"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "iedriverVersion": "4.14.0"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'internet explorer',
      browserVersion: '11',
      platformName: 'WIN10',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        iedriverVersion: '4.14.0'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Remote;

var options = new InternetExplorerOptions
{
    PlatformName = "WIN10",
    BrowserVersion = "11"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["iedriverVersion"] = "4.14.0"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value Possible Values:
string 2.53.1
x64_4.14.0
4.14.0
x64_4.11.0
4.11.0
x64_4.10.0
4.10.0
x64_4.8.1
4.8.1
x64_4.8.0
4.8.0
x64_4.7.0
4.7.0
x64_4.6.0
4.6.0
x64_4.3.0
4.3.0
x64_4.2.0
4.2.0
x64_4.0.0
4.0.0
x64_3.141.59
3.141.59
x64_3.141.5
3.141.5
x64_3.141.0
3.141.0
x64_3.14.0
3.14.0
x64_3.13.0
3.13.0
x64_3.12.0
3.12.0
x64_3.11.1
3.11.1
x64_3.11.0
3.11.0
x64_3.10.0
3.10.0
x64_3.9.0
3.9.0
x64_3.8.0
3.8.0
x64_3.7.0
3.7.0
x64_3.6.0
3.6.0
x64_3.5.0
3.5.0
x64_3.4.0
3.4.0
x64_3.3.0
3.3.0
x64_3.2.0
3.2.0
x64_3.1.0
3.1.0
x64_2.53.1
2.53.1
x64_2.53.0
2.53.0
x64_2.52.2
2.52.2
x64_2.51.0
2.51.0
x64_2.50.0
2.50.0
x64_2.49.0
2.49.0
x64_2.48.0
2.48.0
x64_2.47.0
2.47.0
x64_2.46.0
2.46.0
x64_2.45.0
2.45.0
x64_2.42.0
2.42.0

Edge Driver (MicrosoftWebDriver)

EdgeDriver is built by Microsoft to automate the Microsoft Edge Browser.
By default, we make sure that the most recent fully-compatible EdgeDriver is used for every test running on the Microsoft Edge Browser.

require 'selenium-webdriver'

options = Selenium::WebDriver::Edge::Options.new
options.platform_name = 'WIN11'
options.browser_version = '141'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'edgedriverVersion' => '141'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
EdgeOptions options = new EdgeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("141");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("edgedriverVersion", "141");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::microsoftEdge();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', '141');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'edgedriverVersion' => '141'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.edge.options import Options as EdgeOptions

options = EdgeOptions()
options.platform_name = "WIN11"
options.browser_version = "141"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "edgedriverVersion": "141"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'MicrosoftEdge',
      browserVersion: '141',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        edgedriverVersion: '141'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Edge;
using OpenQA.Selenium.Remote;

var options = new EdgeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "141"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["edgedriverVersion"] = "141"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value Possible Values:
string 15063
141
140
139
138
137
136
135
134
133
132
131
130
129
128
127
126
125
124
123
122
121
120
119
118
117
116
115
114
113
112
111
110
109
108
107
106
105
104
103
102
101
100
99
98
97
96
95
94
93
92
91
90
89
88
87
86
85
84
83
81
dev
insiders
16299
15063
14393

Firefox Driver (Geckodriver)

For Firefox 47 and up, webdriver tests on Firefox need to use Mozilla's GeckoDriver.
Specify this option to choose which Geckodriver we should use. By default, we use the version that is most compatible with the Firefox version you request.

require 'selenium-webdriver'

options = Selenium::WebDriver::Firefox::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'geckodriverVersion' => '0.36.0'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
FirefoxOptions options = new FirefoxOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("geckodriverVersion", "0.36.0");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::firefox();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'geckodriverVersion' => '0.36.0'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions

options = FirefoxOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "geckodriverVersion": "0.36.0"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'firefox',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        geckodriverVersion: '0.36.0'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Remote;

var options = new FirefoxOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["geckodriverVersion"] = "0.36.0"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value Possible Values:
string 0.28.0
0.36.0
0.35.0
0.34.0
0.33.0
0.32.2
0.32.1
0.32.0
0.31.0
0.30.0
0.29.1
0.29.0
0.28.0
0.27.0
0.26.0
0.25.0
0.24.0
0.23.0
0.22.0
0.21.0
0.20.1
0.19.1
0.19.0
0.18.0
0.17.0
0.16.1
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
0.10.0
0.9.0
0.8.0
0.7.1
0.6.2

Opera Driver

Opera uses the Chromium OperaDriver to automate Opera Desktop Browsers.
Specify this option to choose which OperaDriver we should use. By default, we use the version that is most compatible with the Opera version you request.

require 'selenium-webdriver'

options = Selenium::WebDriver::Remote::Capabilities.new(
  browser_name: 'opera',
  platform_name: 'WIN11',
  browser_version: '138',
  'tb:options' => {
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'operaDriverVersion' => '138.0.7204.251'
  }
)

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', capabilities: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
MutableCapabilities options = new MutableCapabilities();
options.setCapability("browserName", "opera");
options.setCapability("platformName", "WIN11");
options.setCapability("browserVersion", "138");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("operaDriverVersion", "138.0.7204.251");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::opera();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', '138');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'operaDriverVersion' => '138.0.7204.251'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.common.options import ArgOptions

options = ArgOptions()
options.set_capability("browserName", "opera")
options.platform_name = "WIN11"
options.browser_version = "138"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "operaDriverVersion": "138.0.7204.251"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'opera',
      browserVersion: '138',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        operaDriverVersion: '138.0.7204.251'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chromium;
using OpenQA.Selenium.Remote;

var options = new OperaDriverOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "138"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["operaDriverVersion"] = "138.0.7204.251"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}

// Selenium 4 for .NET has no Opera options class; this minimal one sends browserName "opera".
class OperaDriverOptions : ChromiumOptions
{
    public OperaDriverOptions() { BrowserName = "opera"; }
    protected override string VendorPrefix => "opr";
    public override string CapabilityName => "operaOptions";
}
Value Type Default Value Possible Values:
string 145.0.7632.117
146.0.7680.178
145.0.7632.117
144.0.7559.173
143.0.7499.194
142.0.7444.243
141.0.7390.125
140.0.7339.249
139.0.7258.156
138.0.7204.251
137.0.7151.122
135.0.7049.115
134.0.6998.205
133.0.6943.143
132.0.6834.209
131.0.6778.86
130.0.6723.137
128.0.6613.162
127.0.6533.120
126.0.6478.127
125.0.6422.143
124.0.6367.62
123.0.6312.59
122.0.6261.95
121.0.6167.140
120.0.6099.200
119.0.6045.124
118.0.5993.89
117.0.5938.132
116.0.5845.97
115.0.5790.171
114.0.5735.110
113.0.5672.127
112.0.5615.87
111.0.5563.65
110.0.5481.100
109.0.5414.120
108.0.5359.99
107.0.5304.88
106.0.5249.119
105.0.5195.102
104.0.5112.81
103.0.5060.66
102.0.5005.61
101.0.4951.64
100.0.4896.127
99.0.4844.51
98.0.4758.82
97.0.4692.71
96.0.4664.45
95.0.4638.54
94.0.4606.61
93.0.4577.63
92.0.4515.107
91.0.4472.77
90.0.4430.85
89.0.4389.82
88.0.4324.104
87.0.4280.67
86.0.4240.80
85.0.4183.102
84.0.4147.89
83.0.4103.97
81.0.4044.113
80.0.3987.100
79.0.3945.79
78.0.3904.87
77.0.3865.120
76.0.3809.132
75.0.3770.100
2.45
2.42
2.41
2.40
2.38
2.37
2.36
2.35
2.33
2.32
2.30
2.229
2.27
2.26
2.25
2.24
2.23
2.22

Taking screenshots during your tests

By default we do not capture screenshots at every step of your test. If you wish to take a screenshot for every step, please add this capability (set to true) to your request.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'screenshot' => true
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("screenshot", true);
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'screenshot' => true
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "screenshot": True
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        screenshot: true
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["screenshot"] = true
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value
boolean false

Make a video of your tests

By default we record a video of your test, which is accessible in the member area. If you do not wish to have this, you can disable it with this option.
Recording adds processing overhead for the duration of the session, so disabling it speeds up tests that do not need a video. See test speed optimization.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'screenrecorder' => true
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("screenrecorder", true);
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'screenrecorder' => true
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "screenrecorder": True
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        screenrecorder: true
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["screenrecorder"] = true
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value
boolean true

Test Privacy

Make the test results for this test public so that everyone can access the results.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'public' => false
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("public", false);
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'public' => false
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "public": False
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        public: false
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["public"] = false
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value
boolean false

Blacklist hostnames

The hostnames you specify will be pointed to localhost instead of their real destination. This means you can speed up tests by blocking third party content which you don't need and slows down your test.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'blacklist' => 'site1.com,site2.com'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("blacklist", "site1.com,site2.com");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'blacklist' => 'site1.com,site2.com'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "blacklist": "site1.com,site2.com"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        blacklist: 'site1.com,site2.com'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["blacklist"] = "site1.com,site2.com"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type
string (comma-separated)

Customize Logging

By default, TestingBot records logs of all Selenium actions and its drivers.

Set this option to false if you don't want TestingBot to record anything (for example, if you have sensitive data).
You will not see any test logs in our member dashboard.

Set to strip-parameters to prevent the POST/GET parameters from being logged on the TestingBot test detail page (does not affect other logs like Selenium logs, Chromedriver logs, ...).

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'recordLogs' => true
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("recordLogs", true);
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'recordLogs' => true
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "recordLogs": True
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        recordLogs: true
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["recordLogs"] = true
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value Possible Values:
string "true" true, false, or strip-parameters

Custom Time Zones

Change the Time Zone of the Virtual Machine to the Time Zone you specify. You can find a list of timezones on Wikipedia. Only location names are supported (not their paths). See some examples below:

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'timeZone' => 'Etc/UTC'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("timeZone", "Etc/UTC");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'timeZone' => 'Etc/UTC'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "timeZone": "Etc/UTC"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        timeZone: 'Etc/UTC'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["timeZone"] = "Etc/UTC"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value Possible Values:
string "Etc/UTC" List of timezones

Light or Dark Appearance

Sets the operating system's appearance to light or dark mode for the whole session, on Windows and macOS. Websites that follow the prefers-color-scheme media query then render the same way on every run, which keeps screenshots and visual comparisons stable. Without this option, the machine keeps its default appearance.

This option is for desktop browsers. For mobile devices, see Dark mode testing with Appium.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'appearance' => 'dark'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("appearance", "dark");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'appearance' => 'dark'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "appearance": "dark"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        appearance: 'dark'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["appearance"] = "dark"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value Possible Values:
string none (the machine default) light, dark

Remove the Desktop Wallpaper

Replaces the desktop background picture with a plain background, on Windows, macOS and Linux. This is useful when your test takes screenshots of the whole screen, or records video of a desktop app, and the wallpaper should not show up in them.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'wallpaper' => 'remove'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("wallpaper", "remove");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'wallpaper' => 'remove'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "wallpaper": "remove"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        wallpaper: 'remove'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["wallpaper"] = "remove"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value Possible Values:
string none (the default wallpaper) remove

Custom DNS Server

Makes the machine resolve hostnames through the DNS server you specify, instead of the default one. Use this to test against a DNS server that returns your staging addresses. The machine's DNS settings are restored after the session.

This option is supported on macOS and Linux. On macOS you can pass several servers separated by a space; on Linux pass a single IPv4 address. An invalid value makes the session fail to start. To point a few hostnames to other addresses, the hosts option is simpler.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'SEQUOIA'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'dns' => '1.1.1.1'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("SEQUOIA");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("dns", "1.1.1.1");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'SEQUOIA');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'dns' => '1.1.1.1'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "SEQUOIA"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "dns": "1.1.1.1"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'SEQUOIA',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        dns: '1.1.1.1'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "SEQUOIA",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["dns"] = "1.1.1.1"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value Possible Values:
string none (the default DNS server) The IP address of a DNS server, for example 1.1.1.1

Change Screen Resolution

Will adjust the screen resolution during your test.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'screen-resolution' => '1280x1024'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("screen-resolution", "1280x1024");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'screen-resolution' => '1280x1024'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "screen-resolution": "1280x1024"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        'screen-resolution': '1280x1024'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["screen-resolution"] = "1280x1024"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value
string "1280x1024"
Platform Resolutions
Windows/Linux
800x600
1024x768
1152x864
1280x768
1280x800
1280x960
1280x1024
1400x1050
1600x1200
1680x1050
1920x1080
1920x1200
2560x1440
macOS
800x600
1024x768
1280x768
1280x800
1280x960
1280x1024
1366x768
1440x900
1600x900
1600x1200
1680x1050
1920x1080
1920x1200
2048x1536

Customize OS

When you specify a prerun file, we will first download the file and execute it (with optional prerun-arguments).
This is useful when you want to customize/add software before your test starts.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'prerun' => 'https://...'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("prerun", "https://...");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'prerun' => 'https://...'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "prerun": "https://..."
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        prerun: 'https://...'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["prerun"] = "https://..."
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type
string (URL)
{
  "tb:options": {
    "prerun-args": "-a -b -c ..."
  }
}
Value Type
string

With TestingBot Storage, you can upload your executable on our servers.
The advantage of this is that our test VMs can immediately download your executable from our own network, which is much faster than downloading from the public internet.
Once the file is uploaded via TestingBot Storage, you can use "prerun" : "tb://..."

Supported file types

We detect what you send and run it the right way. Supported types:

  • .exe — executed directly
  • .msi — installed silently via msiexec /i <file> /quiet /norestart
  • .bat / .cmd — run via cmd
  • .ps1 — run via powershell -ExecutionPolicy Bypass -File
  • .jar — run via java -jar
  • Shell scripts (.sh, .command) on macOS / Linux
  • Archives (.zip, .tar, .tar.gz) — automatically extracted, then an entrypoint inside is run (see below)

Pre-run options

All options below can be passed as individual capabilities inside tb:options, or set on the advanced object form of prerun described further down.

Capability Object key Type Description
prerun executable string (URL), object or array The pre-run file to download and run. A https:// or tb:// URL, or an object / array for the advanced forms below.
prerun-args args string or array Command-line arguments. As a string, quoted arguments with spaces are preserved, e.g. --dir "C:\Program Files\App". An array is passed through as-is.
prerun-wait background (inverse) boolean Wait for the pre-run process to finish before the test starts. Default false (fire-and-forget). In the object form use background: true to not wait.
prerun-timeout timeout integer (ms) Maximum time to wait for the download to complete.
prerun-wait-timeout waitTimeout integer (ms) When waiting (prerun-wait), the maximum time to wait for the pre-run process to finish. If it is still running after this, it is terminated. Unset by default (waits indefinitely).
prerun-fail-on-error failOnError boolean Fail the session (instead of continuing) when the pre-run cannot run, or — when waiting — exits with a non-zero code or exceeds prerun-wait-timeout. Default false.
prerun-entrypoint entrypoint string For archives: the file inside the archive to run. When omitted we auto-detect setup.exe, install.bat, prerun.*, run.*, or the single runnable file at the root.
prerun-sha256 sha256 string Expected SHA-256 checksum of the downloaded file. Verified before execution; a mismatch fails the pre-run.
prerun-env env JSON object Extra environment variables for the pre-run process.
prerun-cwd cwd string Working directory the pre-run process is started in.
prerun-platform platform string Only run on the given platform(s): windows, mac, linux (comma-separated). Useful with the array form.

Advanced object form

Instead of a plain URL, prerun accepts an object so you can set every option in one place:

{
  "tb:options": {
    "prerun": {
      "executable": "https://.../installer.msi",
      "args": ["/quiet"],
      "wait": true,
      "timeout": 120000,
      "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
      "failOnError": true
    }
  }
}

Archives & entrypoint

When the download is a .zip, .tar or .tar.gz, we extract it and run an entrypoint inside. Name it explicitly with entrypoint, or let us auto-detect it:

{
  "tb:options": {
    "prerun": {
      "executable": "https://.../bundle.zip",
      "entrypoint": "setup.exe",
      "args": ["/S"],
      "wait": true
    }
  }
}

Inline scripts

For small tweaks you don't need to host a file — provide the script inline and pick a shell (sh, bash, cmd, bat, powershell or python). Set scriptEncoding: "base64" if you base64-encode the body.

{
  "tb:options": {
    "prerun": {
      "script": "Set-ItemProperty -Path 'HKCU:\\Console' -Name 'QuickEdit' -Value 0",
      "shell": "powershell",
      "wait": true
    }
  }
}

Multiple pre-runs

Pass an array to run several pre-runs in order. Each entry can be a URL, an object, or an inline script, and carries its own options:

{
  "tb:options": {
    "prerun": [
      { "executable": "https://.../install-cert.exe", "args": ["/S"], "wait": true },
      { "script": "echo done > C:\\prerun.log", "shell": "cmd", "wait": true }
    ]
  }
}

Per-platform pre-runs

Reuse the same capabilities across a mixed pool by keying the pre-run per operating system. We pick the entry matching the VM's platform, falling back to default when present. Keys without a match are skipped (not an error).

{
  "tb:options": {
    "prerun": {
      "windows": { "executable": "https://.../setup.exe", "args": ["/S"] },
      "mac":     { "script": "defaults write ...", "shell": "sh" },
      "default": "https://.../fallback.sh"
    }
  }
}

Pre-run failures are non-fatal by default: if the download or script fails, your test still starts. Set failOnError (or prerun-fail-on-error) to make a failed pre-run stop the session instead.

Edit hostnames

You can specify an array of objects containing the keys ip and domain. We will write these values to the hosts file of the VM.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'hosts' => [{ 'ip' => '127.0.0.1', 'domain' => 'mydomain' }]
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("hosts", List.of(Map.of("ip", "127.0.0.1", "domain", "mydomain")));
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'hosts' => [['ip' => '127.0.0.1', 'domain' => 'mydomain']]
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "hosts": [{"ip": "127.0.0.1", "domain": "mydomain"}]
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        hosts: [{ ip: '127.0.0.1', domain: 'mydomain' }]
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["hosts"] = new[]
    {
        new Dictionary<string, string> { ["ip"] = "127.0.0.1", ["domain"] = "mydomain" }
    }
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type
array of objects ({ ip: "", domain: "" })

Upload file

When you specify an URL (upload) and fileName (uploadFilepath), we will automatically download the file from the URL and save it in the uploadFilepath.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'upload' => 'https://...',
  'uploadFilepath' => 'C:\\test\\myfile.ext'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("upload", "https://...");
tbOptions.put("uploadFilepath", "C:\\test\\myfile.ext");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'upload' => 'https://...',
    'uploadFilepath' => 'C:\\test\\myfile.ext'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "upload": "https://...",
    "uploadFilepath": "C:\\test\\myfile.ext"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        upload: 'https://...',
        uploadFilepath: 'C:\\test\\myfile.ext'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["upload"] = "https://...",
    ["uploadFilepath"] = "C:\\test\\myfile.ext"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type
string (URL)

We recommend using these directories to save your files: For Windows (C:\test\), for Linux/macOS: (/tmp/).

You can also use the home directory tilde to specify the user's directory: ~/Desktop/sample.pdf

Example:
{
  "tb:options": {
    "uploadFilepath": "C:\\test\\myfile.ext"
  }
}
Value Type
string (URL)

Upload Multiple Files

Specify an array of objects, containing keys url and filePath. We will automatically download these files and put them in the filePaths you specify.

We recommend using these directories to save your files: For Windows (C:\test\), for Linux/macOS: (/tmp/).

You can also use the home directory tilde to specify the user's directory: ~/Desktop/sample.pdf

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'uploadMultiple' => [{ 'url' => 'https://example.com/file.pdf', 'filePath' => '/tmp/file.pdf' }]
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("uploadMultiple", List.of(Map.of("url", "https://example.com/file.pdf", "filePath", "/tmp/file.pdf")));
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'uploadMultiple' => [['url' => 'https://example.com/file.pdf', 'filePath' => '/tmp/file.pdf']]
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "uploadMultiple": [{"url": "https://example.com/file.pdf", "filePath": "/tmp/file.pdf"}]
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        uploadMultiple: [{ url: 'https://example.com/file.pdf', filePath: '/tmp/file.pdf' }]
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["uploadMultiple"] = new[]
    {
        new Dictionary<string, string> { ["url"] = "https://example.com/file.pdf", ["filePath"] = "/tmp/file.pdf" }
    }
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type
array of objects, { url: "", filePath: "" }

Geolocation Testing

We provide an option where you can specify from which country you'd like to run the test from.

Once you specify this option, the virtual machine we provision for your test will be configured to use a proxy in the country you specified.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'testingbot.geoCountryCode' => 'DE'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("testingbot.geoCountryCode", "DE");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'testingbot.geoCountryCode' => 'DE'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "testingbot.geoCountryCode": "DE"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        'testingbot.geoCountryCode': 'DE'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["testingbot.geoCountryCode"] = "DE"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}

Specify testingbot.geoCountryCode with one of the following country codes:

  • '*': this will take a random country from the list below
  • 'AU': Australia
  • 'BE': Belgium
  • 'BR': Brazil
  • 'CA': Canada
  • 'CL': Chile
  • 'FR': France
  • 'DE': Germany
  • 'IN': India
  • 'IT': Italy
  • 'JP': Japan
  • 'NO': Norway
  • 'SG': Singapore
  • 'ZA': South Africa
  • 'SE': Sweden
  • 'CH': Switzerland
  • 'AE': United Arab Emirates
  • 'GB': United Kingdom
  • 'US': United States

Other country codes are not supported: the session fails to start with an error that lists the supported codes.

Geolocation and the TestingBot Tunnel cannot be combined. Both work by routing the browser's traffic through a proxy. If you set testingbot.geoCountryCode together with a tunnel or your own proxy capability, the session fails to start. Remove one of the two.

Important: this does not work on Android 4.4

Localhost Testing

By default, the TestingBot remote VMs are not able to access your localhost, as they are running in a separate network. However, you can use the localhost address to access your local web server when using the TestingBot Tunnel.

Once you have the TestingBot Tunnel running, these localhost ports will be forwarded to your machine:

  • 80
  • 443
  • 8080
  • 3030
  • 3000
  • 3001
  • 3400

You can also specify additional ports to forward by using the localHttpPorts capability.

If the localhost port is expecting SSL traffic, you can specify the port in the localHttpsPorts capability.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'localHttpPorts' => [3002, 8081]
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("localHttpPorts", List.of(3002, 8081));
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'localHttpPorts' => [3002, 8081]
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "localHttpPorts": [3002, 8081]
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        localHttpPorts: [3002, 8081]
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["localHttpPorts"] = new[] { 3002, 8081 }
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}

Change Test Name

Add a name to this test, which will show up in our member area and API.
Keep test names to 255 characters or fewer and avoid emoji. Other Unicode characters, such as accents and non-Latin scripts, are fine.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'name' => 'My Test Name'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("name", "My Test Name");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'name' => 'My Test Name'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "name": "My Test Name"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        name: 'My Test Name'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["name"] = "My Test Name"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value
string unnamed test

Group Tests

A key you can use to group certain tests in the same build (for example in Jenkins).
The builds will appear in our member area.

Tests are grouped by build name with no time limit: every test that uses the same build name, today or months from now, is added to the same build. To get a separate build for every CI run, include something unique in the name, such as the CI run number (for example checkout-suite-${BUILD_NUMBER} in Jenkins or checkout-suite-${GITHUB_RUN_ID} in GitHub Actions).

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'build' => 'My First Build'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("build", "My First Build");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'build' => 'My First Build'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "build": "My First Build"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        build: 'My First Build'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["build"] = "My First Build"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type
string

Idle Timeout

The maximum amount of time a browser will wait before proceeding to the next step in your test.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'idletimeout' => 130
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("idletimeout", 130);
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'idletimeout' => 130
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "idletimeout": 130
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        idletimeout: 130
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["idletimeout"] = 130
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value
int (specify number of seconds) 120 seconds, plus a 15-second grace period before the session is ended

Maximum Test Duration

The maximum duration for a single test. This is a safeguard to prevent bad tests from using up your credits.

We generally recommend to keep tests short (less than 10 minutes). It's better to split up large tests in smaller individual tests.
This keeps your tests fast and allows for more parallelization of your tests.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'maxduration' => 1800
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("maxduration", 1800);
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'maxduration' => 1800
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "maxduration": 1800
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        maxduration: 1800
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["maxduration"] = 1800
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Default Value
int (specify number of seconds) 1800 seconds (30 minutes)

Custom Metadata

Send along custom data, for example your release, server, commit hash, ...
This will show up on the test detail page in the TestingBot member area.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'extra' => 'Extra Information'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("extra", "Extra Information");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'extra' => 'Extra Information'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "extra": "Extra Information"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        extra: 'Extra Information'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["extra"] = "Extra Information"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type
string

Load custom browser extensions

If you specify this desired capability with the URL to your Chrome extension's .crx file, Safari App/Web extension file, or Firefox addon's .xpi file, we will download the extension, which will be added to the browser before your test starts.

More information is available in the automated browser extension testing documentation.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'load-extension' => 'https://...'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("load-extension", "https://...");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'load-extension' => 'https://...'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "load-extension": "https://..."
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        'load-extension': 'https://...'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["load-extension"] = "https://..."
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Browser Supported Format Example
Chrome .zip file, containing the extension source code (manifest.json, src/ directory, ...) https://.../extension.zip
Firefox .zip file, containing the extension source code (manifest.json, src/ directory, lib/ directory, ...) https://.../extension.zip
Edge .zip file, containing the extension source code (manifest.json, src/ directory, ...) https://.../extension.zip
Safari (and Safari Technology Preview) Safari Web Extension, Safari App Extension or .safariextz file https://.../extension.zip or https://.../extension.safariextz

With TestingBot Storage, you can upload your executable on our servers.
The advantage of this is that our test VMs can immediately download your executable from our own network, which is much faster than downloading from the public internet.
Once the file is uploaded via TestingBot Storage, you can use "prerun" : "tb://..."

Grouping

Specify in which groups you want to see the test results. You can group results to have an easy overview of tests across projects.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'groups' => 'group1,group2'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("groups", "group1,group2");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'groups' => 'group1,group2'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "groups": "group1,group2"
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        groups: 'group1,group2'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["groups"] = "group1,group2"
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type
string (comma-separated)

AutoClicker

Specify one or more of the possible options below to have TestingBot automatically click certain dialogs which are unable to be automated via Selenium WebDriver.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'autoclick' => ['chrome_extension_add']
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("autoclick", List.of("chrome_extension_add"));
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'autoclick' => ['chrome_extension_add']
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "autoclick": ["chrome_extension_add"]
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        autoclick: ['chrome_extension_add']
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["autoclick"] = new[] { "chrome_extension_add" }
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type Possible Values:
array of options chrome_extension_add, chrome_extension_permissions_allow

Sikuli

Specify an URL to a zip-file containing one or more .sikulu projects. These will automatically start before your test runs, so that you can do certain automated tasks which Selenium cannot do (clicking native dialogs, ...)

Find more information regarding Sikuli Cloud Testing.

require 'selenium-webdriver'

options = Selenium::WebDriver::Chrome::Options.new
options.platform_name = 'WIN11'
options.browser_version = 'latest'
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET',
  'sikuli' => 'https://...'
})

driver = Selenium::WebDriver.for(:remote, url: 'https://hub.testingbot.com/wd/hub', options: options)
begin
  driver.navigate.to 'https://testingbot.com'
  raise "Unexpected title: #{driver.title}" unless driver.title.include?('TestingBot')
ensure
  driver.quit
end
ChromeOptions options = new ChromeOptions();
options.setPlatformName("WIN11");
options.setBrowserVersion("latest");

Map<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
tbOptions.put("sikuli", "https://...");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(URI.create("https://hub.testingbot.com/wd/hub").toURL(), options);
try {
    driver.get("https://testingbot.com");
    if (!driver.getTitle().contains("TestingBot")) {
        throw new AssertionError("Unexpected title: " + driver.getTitle());
    }
} finally {
    driver.quit();
}
<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

$caps = DesiredCapabilities::chrome();
$caps->setCapability('platformName', 'WIN11');
$caps->setCapability('browserVersion', 'latest');
$caps->setCapability('tb:options', [
    'key' => 'API_KEY',
    'secret' => 'API_SECRET',
    'sikuli' => 'https://...'
]);

$driver = RemoteWebDriver::create('https://hub.testingbot.com/wd/hub', $caps);
try {
    $driver->get('https://testingbot.com');
    if (strpos($driver->getTitle(), 'TestingBot') === false) {
        throw new Exception('Unexpected title: ' . $driver->getTitle());
    }
} finally {
    $driver->quit();
}
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions

options = ChromeOptions()
options.platform_name = "WIN11"
options.browser_version = "latest"
options.set_capability("tb:options", {
    "key": "API_KEY",
    "secret": "API_SECRET",
    "sikuli": "https://..."
})

driver = webdriver.Remote(command_executor="https://hub.testingbot.com/wd/hub", options=options)
try:
    driver.get("https://testingbot.com")
    assert "TestingBot" in driver.title
finally:
    driver.quit()
const { Builder } = require('selenium-webdriver');

(async () => {
  const driver = await new Builder()
    .usingServer('https://hub.testingbot.com/wd/hub')
    .withCapabilities({
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'WIN11',
      'tb:options': {
        key: 'API_KEY',
        secret: 'API_SECRET',
        sikuli: 'https://...'
      }
    })
    .build();
  try {
    await driver.get('https://testingbot.com');
    const title = await driver.getTitle();
    if (!title.includes('TestingBot')) throw new Error(`Unexpected title: ${title}`);
  } finally {
    await driver.quit();
  }
})();
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions
{
    PlatformName = "WIN11",
    BrowserVersion = "latest"
};
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET",
    ["sikuli"] = "https://..."
});

var driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"), options);
try
{
    driver.Navigate().GoToUrl("https://testingbot.com");
    if (!driver.Title.Contains("TestingBot"))
        throw new Exception($"Unexpected title: {driver.Title}");
}
finally
{
    driver.Quit();
}
Value Type
string (URL to zipped Sikuli project)
Was this page helpful?
Last updated