Features

Mobile App Options

Please see the examples below on how to customize your test run on our mobile emulators and devices.

Appium Options

Appium provides a lot of options to configure your test.

Some important options that might help:


For Android:
  • appActivity and appPackage: by default, Appium will try to extract the main Activity from your apk. If this fails, you can supply your own with these options.
  • chromeOptions: additional chromedriver options you can supply.
  • otherApps: a JSON array of other apps that need to be installed, in URL format.

For Android & iOS:
  • locale: the language of the simulator/device (ex: fr_CA)
  • newCommandTimeout: How long (in seconds) Appium will wait for a new command from the client before assuming the client quit and ending the session

Specifying Appium Version

TestingBot will use the most recent, compatible, Appium version according to the device, OS and version you specify.
If you'd like to specify your own Appium version, you can do this with the appiumVersion capability.


caps = Selenium::WebDriver::Remote::Capabilities.new
caps["appiumVersion"] = "2.0.0-beta.44"
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("appiumVersion", "2.53.1");
$caps = array(
  "appiumVersion" => "2.0.0-beta.44"
);
capabilities = {
  "appiumVersion" : "2.0.0-beta.44"
}
const capabilities = {
  "appiumVersion" : "2.0.0-beta.44"
}
DesiredCapabilities caps = new DesiredCapabilities();
caps.SetCapability("appiumVersion", "2.0.0-beta.44");

Selenium W3C Example:

caps = {
  platformName: "iOS",
  deviceName: "iPhone 13",
  browserVersion: "16.0",
  browserName: 'safari',
  "tb:options" => {
    "appiumVersion" : "2.0.0-beta.44"
  }
}
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("appiumVersion", "2.0.0-beta.44");

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "iOS");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("deviceName", "iPhone 13");
caps.setCapability("browserVersion", "16.0");
caps.setCapability("browserName", "safari");
$options = new ChromeOptions();
$capabilities = DesiredCapabilities::safari();
$capabilities->setPlatform('iOS');
$capabilities->setCapability('tb:options', array(
	'appiumVersion' => "2.0.0-beta.44"
));
$capabilities->setCapability(ChromeOptions::CAPABILITY, $options);
tbOptions = {
	'name': 'W3C Sample',
	'appiumVersion': "2.0.0-beta.44"
}

chromeOpts =  {
    'browserName': "safari",
    'platformName': "iOS",
    'browserVersion': "16.0",
    'deviceName': "iPhone 13",
    'goog:chromeOptions': {'w3c': True},
    'tb:options': tbOptions
}

self.driver = webdriver.Remote(remote_url, desired_capabilities=chromeOpts)
driver = await new webdriver.Builder().withCapabilities({
    "browserName": 'safari',
    "platformName": 'iOS',
    "deviceName": 'iPhone 13',
    "browserVersion": '16.0',

    /** Google requires "w3c" to be set in "goog:chromeOptions" as true if you're using ChromeDriver version 74 or lower.
     * Based on this commit: https://chromium.googlesource.com/chromium/src/+/2b49880e2481658e0702fd6fe494859bca52b39c
     * ChromeDriver now uses w3c by default from version 75+ so setting this option will no longer be a requirement **/
    "goog:chromeOptions" : { "w3c" : true },
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "appiumVersion": "2.0.0-beta.44"
    }
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
    BrowserVersion = "16.0",
    PlatformName = "iOS",
    DeviceName = "iPhone 13",
    BrowserName = "safari",
    UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["appiumVersion"] = "2.0.0-beta.44"
};

chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);

driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    chromeOptions.ToCapabilities(), TimeSpan.FromSeconds(600));

Throttle Network

TestingBot provides a throttle network feature, which will simulate specific network conditions during a test.

We offer various presets:

  • Edge:
    • 250kbps download
    • 150kbps upload
    • 0% Loss
    • 300ms Latency
  • 3G:
    • 400kbps download
    • 100kbps upload
    • 0% Loss
    • 100ms Latency
  • 4G:
    • 18000kbps download
    • 9000kbps upload
    • 0% Loss
    • 100ms Latency
  • airplane:

    Simulates Airplane Mode (no network connectivity)

  • disable:

    Revert the throttling to no throttling.


We also offer the possibility to specify your own download, upload, loss and latency values.

You can pass a preset or specific options at the start of your test (through the capabilities), or during the test (with execute_script).


At the start of a test:
caps = {
  throttle_network: "3G",
  throttle_network: {
    uploadSpeed: 10 * 1024,
    downloadSpeed: 10 * 1024,
    latency: 0,
    loss: 0
  }
}
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("throttle_network", "3G");

MutableCapabilities throttleOptions = new MutableCapabilities();
throttleOptions.setCapability("uploadSpeed", 10 * 1024);
throttleOptions.setCapability("downloadSpeed", 10 * 1024);
throttleOptions.setCapability("latency", 0);
throttleOptions.setCapability("loss", 0);
tbOptions.setCapability("throttle_network", throttleOptions);

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("tb:options", tbOptions);
caps.setCapability("browserName", "chrome");
$options = new ChromeOptions();
$capabilities = DesiredCapabilities::chrome();
$capabilities->setPlatform('Windows 10');
$capabilities->setCapability('tb:options', array(
	'selenium-version' => '2.53.1',
	'throttle_network' => '3G',
	'throttle_network' => array(
		'uploadSpeed' => 10 * 1024,
		'downloadSpeed' => 10 * 1024,
		'latency' => 0,
		'loss' => 0
	)
));
$capabilities->setCapability(ChromeOptions::CAPABILITY, $options);
tbOptions = {
	'name': 'W3C Sample',
	'throttle_network': '3G',
	'throttle_network': {
		'uploadSpeed': 10 * 1024,
		'downloadSpeed': 10 * 1024,
		'latency': 0,
		'loss': 0
    }
}

chromeOpts =  {
    'browserName': "chrome",
    'goog:chromeOptions': {'w3c': True},
    'tb:options': tbOptions
}

self.driver = webdriver.Remote(remote_url, desired_capabilities=chromeOpts)
driver = await new webdriver.Builder().withCapabilities({
    "browserName": 'chrome',
    /** Google requires "w3c" to be set in "goog:chromeOptions" as true if you're using ChromeDriver version 74 or lower.
     * Based on this commit: https://chromium.googlesource.com/chromium/src/+/2b49880e2481658e0702fd6fe494859bca52b39c
     * ChromeDriver now uses w3c by default from version 75+ so setting this option will no longer be a requirement **/
    "goog:chromeOptions" : { "w3c" : true },
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "throttle_network": "3G",
        "throttle_network": {
          "uploadSpeed": 10 * 1024,
          "downloadSpeed": 10 * 1024,
          "latency": 0,
          "loss": 0
    	}
    }
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
    BrowserVersion = "latest",
    PlatformName = "Windows 10",
    UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["name"] = TestContext.CurrentContext.Test.Name,
    ["throttle_network"] = "3G"
};

chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);

driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    chromeOptions.ToCapabilities(), TimeSpan.FromSeconds(600));

During a test:
driver.execute_script("tb:throttle", "3G")
# or
driver.execute_script("tb:throttle", {
    "downloadSpeed": 10 * 1024,
    "uploadSpeed": 10 * 1024,
    "latency": 0,
    "loss": 0
})
((JavascriptExecutor) driver).executeScript("tb:throttle", "3G");
// or
Map<String, Object> throttleMap = new HashMap<>();
throttleMap.put("downloadSpeed", 10 * 1024);
throttleMap.put("uploadSpeed", 10 * 1024);
throttleMap.put("latency", 0);
throttleMap.put("loss", 0);
((JavascriptExecutor) driver).executeScript("tb:throttle", throttleMap);
$driver->executeScript("tb:throttle", ["3G"]);
// or
$driver->executeScript("tb:throttle", [
	"downloadSpeed" => 10 * 1024,
	"uploadSpeed" => 10 * 1024,
	"latency" => 0,
	"loss" => 0
]);
driver.execute_script("tb:throttle", "3G")
# or
driver.execute_script("tb:throttle", {
	"downloadSpeed" => 10 * 1024,
	"uploadSpeed" => 10 * 1024,
	"latency" => 0,
	"loss" => 0
})
browser.execute('tb:throttle', '3G')
// or
browser.execute('tb:throttle', { 
    "downloadSpeed" => 10 * 1024,
	"uploadSpeed" => 10 * 1024,
	"latency" => 0,
	"loss" => 0
})
((IJavaScriptExecutor)driver).ExecuteScript("tb:throttle", "3G");
# or
((IJavaScriptExecutor)driver).ExecuteScript("tb:throttle", "{\"downloadSpeed\":10*1024, \"uploadSpeed\": 10*1024, \"latency\": 0, \"loss\": 0}");

To stop network throttling during your test, pass disable: true in the tb:throttle options via the execute_script.

Device Name

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

caps = {
  deviceName: "Samsung S21"	
}
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("deviceName", "Samsung S21");
tbOptions = {
	'name': 'W3C Sample'
}

chromeOpts =  {
    'deviceName': "Samsung S21",
    'platformName': "Android",
    'goog:chromeOptions': {'w3c': True},
    'tb:options': tbOptions
}

self.driver = webdriver.Remote(remote_url, desired_capabilities=chromeOpts)
driver = await new webdriver.Builder().withCapabilities({
    "browserName": 'chrome',
    "deviceName": 'Samsung S21',
    "platformName": 'Android',
    "goog:chromeOptions" : { "w3c" : true },
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret"
    }
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
    PlatformName = "Android",
    UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["name"] = TestContext.CurrentContext.Test.Name,
    ["deviceName"] = "Samsung S21"
};

chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);

driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    chromeOptions.ToCapabilities(), TimeSpan.FromSeconds(600));

Physical Devices Only

We offer special 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("deviceName", "^(iPhone.*)(?!6|6S)$");

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

Tablet Only

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

caps = {
  deviceName: "*",
  tabletOnly: true
}
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("tabletOnly", true);
tbOptions.setCapability("deviceName", "*");

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
tbOptions = {
	'name': 'W3C Sample'
}

chromeOpts =  {
    'deviceName': "*",
    'tabletOnly': true,
    'platformName': "Android",
    'goog:chromeOptions': {'w3c': True},
    'tb:options': tbOptions
}

self.driver = webdriver.Remote(remote_url, desired_capabilities=chromeOpts)
driver = await new webdriver.Builder().withCapabilities({
    "browserName": 'chrome',
    "deviceName": '*',
    "platformName": 'Android',
    "goog:chromeOptions" : { "w3c" : true },
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "tabletOnly": true
    }
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
    PlatformName = "Android",
    UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["name"] = TestContext.CurrentContext.Test.Name,
    ["deviceName"] = "*",
    ["tabletOnly"] = true
};

chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);

driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    chromeOptions.ToCapabilities(), TimeSpan.FromSeconds(600));

Phone Only

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

caps = {
  deviceName: "*",
  phoneOnly: true
}
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("phoneOnly", true);
tbOptions.setCapability("deviceName", "*");

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
tbOptions = {
	'name': 'W3C Sample'
}

chromeOpts =  {
    'deviceName': "*",
    'phoneOnly': true,
    'platformName': "Android",
    'goog:chromeOptions': {'w3c': True},
    'tb:options': tbOptions
}

self.driver = webdriver.Remote(remote_url, desired_capabilities=chromeOpts)
driver = await new webdriver.Builder().withCapabilities({
    "browserName": 'chrome',
    "deviceName": '*',
    "platformName": 'Android',
    "goog:chromeOptions" : { "w3c" : true },
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "phoneOnly": true
    }
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
    PlatformName = "Android",
    UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["name"] = TestContext.CurrentContext.Test.Name,
    ["deviceName"] = "*",
    ["phoneOnly"] = true
};

chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);

driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    chromeOptions.ToCapabilities(), TimeSpan.FromSeconds(600));