Features

Migrate your existing tests

Migrating your existing Selenium WebDriver tests to use TestingBot is easy.
On this page, we'll show you how to modify your existing tests and run them on the browsers in our cloud.

Authentication

First, you'll need to authenticate to the TestingBot cloud.
If you haven't already, please sign up for a free trial and find your TestingBot key and secret in the member area.
You'll need to use these credentials in your test scripts to authenticate with our cloud.


Capabilities

Capabilities are used to indicate on which browsers you want to test.
You can specify a desired browser name, operating system and browser version.


For example, let's say you want to test on the latest Chrome browser on Windows 10:


caps = Selenium::WebDriver::Remote::Capabilities.new

caps['platform'] = 'WIN10'
caps['browserName'] = 'chrome'
caps['version'] = 'latest'
caps['name'] = 'My First Test'
DesiredCapabilities caps = new DesiredCapabilities();

caps.setCapability("platform", "WIN10");
caps.setCapability("browserName", "chrome");
caps.setCapability("version", "latest");
caps.setCapability("name", "My First Test");
$caps = array(
  "version" => "latest",
  "browserName" => "chrome",
  "platform" => "WIN10",
  "name" => "My First Test"
);
desired_cap = {
 'browserName': 'chrome',
 'version': 'latest',
 'platform': 'WIN10',
 'name': 'My First Test'
}
var capabilities = {
  'platform': 'WIN10',
  'browserName': 'chrome',
  'version': 'latest',
  'name': 'My First Test'
}
IWebDriver driver;
// for Chrome
OpenQA.Selenium.Chrome.ChromeOptions capability = new OpenQA.Selenium.Chrome.ChromeOptions();

// for Firefox
OpenQA.Selenium.Firefox.FirefoxOptions capability = new OpenQA.Selenium.Firefox.FirefoxOptions();

// for Safari
OpenQA.Selenium.Safari.SafariOptions capability = new OpenQA.Selenium.Safari.SafariOptions();

capability.AddAdditionalCapability("platform", "WIN10", true);
capability.AddAdditionalCapability("browserName", "chrome", true);
capability.AddAdditionalCapability("version", "latest", true);
capability.AddAdditionalCapability("name", "My First Test", true);

Running tests with Remote WebDriver

If you have been running tests on your local machine until now, then you will need to modify your test scripts to start a WebDriver session via Remote WebDriver.
Simply send the capabilities to our cloud endpoint:


https://API_KEY:API_SECRET@hub.testingbot.com/wd/hub

Below is an example on how to do this:


require "rubygems"
require "selenium-webdriver"

caps = Selenium::WebDriver::Remote::Capabilities.new

caps["browserName"] = "Firefox"
caps["version"] = "latest"
caps["platform"] = "WIN10"
caps["name"] = "firefox profile example"

driver = Selenium::WebDriver.for(:remote,
  :url => "https://API_KEY:API_SECRET@hub.testingbot.com/wd/hub",
  :desired_capabilities => caps)
  driver.navigate.to 'https://www.google.com'

# Your test logic here

driver.quit
import org.openqa.selenium.By;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.URL;

public class TestingBotSampleTest {
    public static final String URL = "https://API_KEY:API_SECRET@hub.testingbot.com/wd/hub";
    public static void main(String[] args) throws Exception {
          DesiredCapabilities caps = new DesiredCapabilities();

          caps.setCapability("platform", "WIN10");
          caps.setCapability("browserName", "Chrome");
          caps.setCapability("version", "latest");

          WebDriver driver = new RemoteWebDriver(new URL(URL), caps);
          driver.get("http://www.google.com");

          // Your test logic here

          driver.quit();
    }
}
<?php 
  require_once('vendor/autoload.php');
  use Facebook\WebDriver\Remote\RemoteWebDriver;
  use Facebook\WebDriver\WebDriverBy;

  $URL = "https://API_KEY:API_SECRET@hub.testingbot.com/wd/hub";

  $caps = array(
    "version" => "latest",
    "browserName" => "chrome",
    "platform" => "WIN10",
    "name" => "My First Test"
  );

  $web_driver = RemoteWebDriver::create(
      $URL,
      $caps
  );

  $web_driver->get("https://www.google.com");

  // Your test logic here

  $web_driver->quit();
from selenium import webdriver

URL = 'https://API_KEY:API_SECRET@hub.testingbot.com/wd/hub'

desired_cap = {
 'browserName': 'chrome',
 'version': 'latest',
 'platform': 'WIN10',
 'name': 'My First Test'
}

driver = webdriver.Remote(
    command_executor=URL,
    desired_capabilities=desired_cap
)

driver.get("https://www.google.com")

# Your test logic here

driver.quit())
var webdriver = require('selenium-webdriver');

var URL = 'https://API_KEY:API_SECRET@hub.testingbot.com/wd/hub';

var capabilities = {
  'platform': 'WIN10',
  'browserName': 'chrome',
  'version': 'latest',
  'name': 'My First Test'
};

var driver = new webdriver.Builder().
usingServer(URL).
withCapabilities(capabilities).
build();

driver.get('http://www.google.com').then(function() {
  // Your test logic here

  driver.quit();
});
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Remote;

namespace SeleniumTest {
  class Program {
    static void Main(string[] args) {
      string KEY = "KEY";
      string SECRET = "SECRET";

      OpenQA.Selenium.Chrome.ChromeOptions capability = new OpenQA.Selenium.Chrome.ChromeOptions();

      // for Firefox
      // OpenQA.Selenium.Firefox.FirefoxOptions capability = new OpenQA.Selenium.Firefox.FirefoxOptions();
      
      // for Safari
      // OpenQA.Selenium.Safari.SafariOptions capability = new OpenQA.Selenium.Safari.SafariOptions();

      capability.AddAdditionalCapability("platform", "WIN10", true);
      capability.AddAdditionalCapability("browserName", "chrome", true);
      capability.AddAdditionalCapability("version", "latest", true);
      capability.AddAdditionalCapability("key", KEY, true);
      capability.AddAdditionalCapability("secret", SECRET, true);
      capability.AddAdditionalCapability("name", "My First Test", true);

      IWebDriver driver;
      driver = new RemoteWebDriver(
        new Uri("https://hub.testingbot.com/wd/hub/"), caps
      );
      driver.Navigate().GoToUrl("http://www.google.com");

      // Your test logic here

      driver.Quit();
    }
  }
}

Migrate from one of the test frameworks

We have documentation for all the popular test frameworks.
Simple follow the documentation and examples to convert your existing tests.


If the test framework you are using is not in our documentation, please contact us and we'll be happy to help.

Test your private websites on TestingBot

TestingBot offers a feature called TestingBot Tunnel which allows you to run tests against websites hosted on your computer or private network.