Skip to main content

Appium tb:options Reference

Reference for the capabilities you can pass to Appium tests on TestingBot: pick a device, pin an Appium version, change timezone or geolocation, throttle the network, record video, group tests under a build, attach custom metadata, and more. Each section includes code examples in Java, Node.js, Python, Ruby and C#.

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

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 = {
  "platformName" => "iOS",
  "appium:automationName" => "XCUITest",
  "appium:deviceName" => "iPhone 13",
  "appium:platformVersion" => "16.0",
  "appium:app" => "https://testingbot.com/appium/sample.ipa",
  "tb:options" => {
    "appiumVersion" => "3.2.2"
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
XCUITestOptions options = new XCUITestOptions();
options.setPlatformName("iOS");
options.setAutomationName("XCUITest");
options.setDeviceName("iPhone 13");
options.setPlatformVersion("16.0");
options.setApp("https://testingbot.com/appium/sample.ipa");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("appiumVersion", "3.2.2");
options.setCapability("tb:options", tbOptions);

IOSDriver driver = new IOSDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'iOS',
    'appium:automationName' => 'XCUITest',
    'appium:deviceName' => 'iPhone 13',
    'appium:platformVersion' => '16.0',
    'appium:app' => 'https://testingbot.com/appium/sample.ipa',
    'tb:options' => array(
        'appiumVersion' => '3.2.2'
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.ios import XCUITestOptions

capabilities = {
    "platformName": "iOS",
    "appium:automationName": "XCUITest",
    "appium:deviceName": "iPhone 13",
    "appium:platformVersion": "16.0",
    "appium:app": "https://testingbot.com/appium/sample.ipa",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "appiumVersion": "3.2.2"
    }
}

options = XCUITestOptions().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "iOS",
    "appium:automationName": "XCUITest",
    "appium:deviceName": "iPhone 13",
    "appium:platformVersion": "16.0",
    "appium:app": "https://testingbot.com/appium/sample.ipa",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "appiumVersion": "3.2.2"
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "iOS";
appiumOptions.AutomationName = "XCUITest";
appiumOptions.DeviceName = "iPhone 13";
appiumOptions.PlatformVersion = "16.0";
appiumOptions.App = "https://testingbot.com/appium/sample.ipa";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["appiumVersion"] = "3.2.2"
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new IOSDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));

Appium Versions

We support both Appium 3 and Appium 2. A full selectable list is available in the capabilities builder. Some of the versions we currently support:

  • 3.2.2
  • 3.0.1
  • 2.17.0
  • 2.11.3
  • 2.10.3
  • 2.9.0
  • 2.5.1
  • 2.4.1

If you specify "appiumVersion": "latest", TestingBot will automatically use the latest Appium version. You can also use latest-1, latest-2, ... to test on the next most recent versions of Appium.

Change Device Timezone

TestingBot allows you to change the timezone of the mobile device (physical or emu/sim) to a timezone that you specify. Simply pass in a timeZone capability specifying a timezone from the list. You can find a list of timezones on Wikipedia.

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "Galaxy S23",
  "appium:platformVersion" => "13.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "timeZone" => "Etc/UTC"
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("Galaxy S23");
options.setPlatformVersion("13.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("timeZone", "Etc/UTC");
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'Android',
    'appium:automationName' => 'UiAutomator2',
    'appium:deviceName' => 'Galaxy S23',
    'appium:platformVersion' => '13.0',
    'appium:app' => 'https://testingbot.com/appium/sample.apk',
    'tb:options' => array(
        'timeZone' => 'Etc/UTC'
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "timeZone": "Etc/UTC"
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "timeZone": "Etc/UTC"
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "Galaxy S23";
appiumOptions.PlatformVersion = "13.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["timeZone"] = "Etc/UTC"
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));
Value Type Default Value Possible Values:
string "Etc/UTC" List of timezones

Localization Options

Please see the Localization Options documentation to learn how to set the locale and language of the device during your automated tests.

Geolocation Testing

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

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

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "Galaxy S23",
  "appium:platformVersion" => "13.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "testingbot.geoCountryCode" => "DE"
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("Galaxy S23");
options.setPlatformVersion("13.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("testingbot.geoCountryCode", "DE");
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'Android',
    'appium:automationName' => 'UiAutomator2',
    'appium:deviceName' => 'Galaxy S23',
    'appium:platformVersion' => '13.0',
    'appium:app' => 'https://testingbot.com/appium/sample.apk',
    'tb:options' => array(
        'testingbot.geoCountryCode' => 'DE'
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "testingbot.geoCountryCode": "DE"
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "testingbot.geoCountryCode": "DE"
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "Galaxy S23";
appiumOptions.PlatformVersion = "13.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["testingbot.geoCountryCode"] = "DE"
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));

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

Important: this does not work on Android 4.4

Upload files to device

You can upload files to the remote iOS or Android device, prior to starting a test. More information is available on this page: upload files to device.

Throttle Network

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

We offer various presets:

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

    Simulates Airplane Mode (no network connectivity)

    On real iOS devices, throttling and airplane mode are applied through the device's HTTP proxy settings, not by switching the radios. Airplane mode blocks traffic that uses the system proxy, such as Safari and most app HTTP(S) requests; connections that bypass the system proxy are not affected.

  • disable:

    Revert the throttling to no throttling.

We also offer the possibility to specify your own download, upload, loss and latency values: downloadSpeed and uploadSpeed in KB/s (1 KB = 1024 bytes), loss in % and latency in ms.

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: {
    uploadSpeed: 10 * 1024,
    downloadSpeed: 10 * 1024,
    latency: 0,
    loss: 0
  }
}
# or use a preset instead: caps = { throttle_network: "3G" }
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setApp("https://testingbot.com/appium/sample.apk");

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

// Use a custom object OR a preset string (e.g. tbOptions.setCapability("throttle_network", "3G");), not both.
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);
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'Android',
    'appium:automationName' => 'UiAutomator2',
    'appium:app' => 'https://testingbot.com/appium/sample.apk',
    // Use a custom array OR a preset string ('throttle_network' => '3G'), not both.
    'tb:options' => array(
        'throttle_network' => array(
            'uploadSpeed' => 10 * 1024,
            'downloadSpeed' => 10 * 1024,
            'latency' => 0,
            'loss' => 0
        )
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.android import UiAutomator2Options

# Use a custom dict OR a preset string ("throttle_network": "3G"), not both.
capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "throttle_network": {
            "uploadSpeed": 10 * 1024,
            "downloadSpeed": 10 * 1024,
            "latency": 0,
            "loss": 0
        }
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        // Use a custom object OR a preset string ("throttle_network": "3G"), not both.
        "throttle_network": {
          "uploadSpeed": 10 * 1024,
          "downloadSpeed": 10 * 1024,
          "latency": 0,
          "loss": 0
        }
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["name"] = TestContext.CurrentContext.Test.Name,
    ["throttle_network"] = "3G"
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, 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
var throttle = new Dictionary<string, object> {
    ["downloadSpeed"] = 10 * 1024,
    ["uploadSpeed"] = 10 * 1024,
    ["latency"] = 0,
    ["loss"] = 0
};
((IJavaScriptExecutor)driver).ExecuteScript("tb:throttle", throttle);

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

mobile: shell

You can execute ADB shell commands during your automated test, with Appium's mobile: shell functionality.

This allows you to fetch or set various settings for the device or emulator, during your automated test. For example, send a custom input event, or use dumpsys, pm clear or others.

When running a test on an emulator, all ADB shell commands are allowed.

For tests running on physical devices, we maintain a whitelist of allowed commands

Whitelisted ADB commands for physical devices:
  • am start
  • am force-stop
  • pm clear
  • input
  • (ls|cp|mkdir|echo|grep|cut|pwd|dumpsys)
  • getprop
  • am compat enable
  • cmd connectivity airplane-mode (enable|disable)
  • settings put global (animator_duration_scale|transition_animation_scale|window_animation_scale) <VALUE>
  • setprop debug.firebase.analytics.app <VALUE>
  • setprop (log.tag.FA|log.tag.FA-SVC) (ERROR|WARN|INFO|DEBUG|VERBOSE)
  • setprop (log.tag.FA|log.tag.FA-SVC|log.tag.GAv4|log.tag.GAv4-SVC) (ERROR|WARN|INFO|DEBUG|VERBOSE)
  • appops set <PACKAGE_NAME> REQUEST_INSTALL_PACKAGES allow

driver.execute_script('mobile: shell', { command: 'input', args: ['keyevent', 3] })
driver.executeScript("mobile: shell", java.util.Map.of(
    "command", "input",
    "args", java.util.List.of("keyevent", "3")
));
$args = [
    "command" => "input",
    "args" => ["keyevent", "3"]
];

$driver->executeScript("mobile: shell", $args);
args = {
    "command": "input",
    "args": ["keyevent", "3"]
}
driver.execute_script("mobile: shell", args)
await driver.executeScript("mobile: shell", {
    command: "input",
    args: ["keyevent", "3"]
});
var args = new Dictionary<string, object>
{
    { "command", "input" },
    { "args", new List<string> { "keyevent", "3" } }
};
((IJavaScriptExecutor)driver).ExecuteScript("mobile: shell", args);

Selecting the device

Capabilities for picking the device, OS version and form factor your Appium test runs on.

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 = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "Pixel 9",
  "appium:platformVersion" => "14.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk"
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("Pixel 9");
options.setPlatformVersion("14.0");
options.setApp("https://testingbot.com/appium/sample.apk");

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

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Pixel 9",
    "appium:platformVersion": "14.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret"
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Pixel 9",
    "appium:platformVersion": "14.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret"
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "Pixel 9";
appiumOptions.PlatformVersion = "14.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret"
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));

You can use a regular expression in deviceName to allocate any device that matches it. This works for real devices, emulators and simulators. Patterns are not limited to devices: browserName, version and platform accept them too, so you can use the same rules for desktop browsers (see below):

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 an iPhone 8, 9, 10 or 11 ([8-11] is the number range 8 through 11, see below)
"iPhone 6.*" This will allocate either an iPhone 6 or 6S

How the pattern is matched

  • The whole name must match. TestingBot wraps your pattern as ^(?:pattern)$ before comparing it, so it has to describe the complete device name, not just a part of it. "Galaxy S" matches no device, while "Galaxy S.*" matches every Galaxy S model.
  • It is compared with the device name only, the same name you see in the device list (for example iPad (9th generation)). The OS version is matched separately, through platformVersion.
  • Matching is case-insensitive. "pixel 9" and "Pixel 9" select the same device.
  • Parentheses and dots are regex syntax. Device names such as iPad (9th generation) contain parentheses. To match them literally, escape them ("iPad \\(9th generation\\)", the backslash written twice inside a Java, JavaScript, C# or JSON string) or skip over them with .* ("iPad.*9th.*"). A pattern that only covers part of the name, such as "iPad Pro 13 M5" for a device called iPad Pro 13-inch (M5), never matches, and the session waits in the queue until it times out.
  • A comma separates alternatives. "Galaxy S24,Pixel 9" allocates whichever of the two is free first. Each alternative is matched against the whole name on its own. Because of this, don't use a comma inside a pattern (for example in a {2,3} quantifier).
  • [from-to] is a number range, not a character class: "iPhone [15-17]" means iPhone 15, 16 or 17. Ranges with single digits, such as [3-6], cover the same numbers either way.
  • The same rules apply to desktop browsers. browserName and version are matched the same way, so "version": "1[38-40]" runs on Chrome 138, 139 or 140, and "browserName": "chrome,firefox" takes whichever of the two is free first.
  • Patterns use JavaScript regular expression syntax, so lookaheads like (?!...) are supported. Patterns longer than 200 characters are rejected.

A test that waits in the queue and then fails with unable to fulfill your request often has a pattern that matches no device. See Appium troubleshooting for tested examples.

Some Examples:

Pattern Matches
"Pixel.*" Any device whose name starts with Pixel
"iPhone 1[67]( Pro)?" iPhone 16, iPhone 16 Pro, iPhone 17 or iPhone 17 Pro, but not the Pro Max models
"iPad.*9th.*" iPad (9th generation), without escaping the parentheses
"iPhone(?!.*Pro).*" Any iPhone except the Pro and Pro Max models
// any iPhone, except the 6s
capabilities.setCapability("deviceName", "iPhone(?! 6s).*");

// any device whose name starts with Pixel
capabilities.setCapability("deviceName", "Pixel.*");

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 targetting a specific iOS or Android device, you can target a wider range of devices.

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "*",
  "appium:platformVersion" => "(13|14).*",
  "appium:app" => "https://testingbot.com/appium/sample.apk"
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("*");
options.setPlatformVersion("(13|14).*");
options.setApp("https://testingbot.com/appium/sample.apk");

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

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "*",
    "appium:platformVersion": "(13|14).*",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret"
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "*",
    "appium:platformVersion": "(13|14).*",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret"
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "*";
appiumOptions.PlatformVersion = "(13|14).*";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret"
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));

Some Examples:

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

// find any Pixel device with Android version 15 or 16
capabilities.setCapability("appium:deviceName", "Pixel.*");
capabilities.setCapability("appium:platformVersion", "(15|16).*");

Tablet Only

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

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "*",
  "appium:platformVersion" => "14.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "tabletOnly" => true
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("*");
options.setPlatformVersion("14.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("tabletOnly", true);
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "*",
    "appium:platformVersion": "14.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "tabletOnly": True
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "*",
    "appium:platformVersion": "14.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "tabletOnly": true
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "*";
appiumOptions.PlatformVersion = "14.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["tabletOnly"] = true
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));

Phone Only

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

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "*",
  "appium:platformVersion" => "14.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "phoneOnly" => true
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("*");
options.setPlatformVersion("14.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("phoneOnly", true);
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "*",
    "appium:platformVersion": "14.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "phoneOnly": True
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "*",
    "appium:platformVersion": "14.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "phoneOnly": true
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "*";
appiumOptions.PlatformVersion = "14.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["phoneOnly"] = true
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));

Customizing the test

Capabilities for naming, grouping, timing out and attaching metadata to your Appium test sessions.

Change Test Name

Add a name to this test, which will show up in the TestingBot member area and API.

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "Galaxy S23",
  "appium:platformVersion" => "13.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "name" => "My Test Name"
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("Galaxy S23");
options.setPlatformVersion("13.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("name", "My Test Name");
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'Android',
    'appium:automationName' => 'UiAutomator2',
    'appium:deviceName' => 'Galaxy S23',
    'appium:platformVersion' => '13.0',
    'appium:app' => 'https://testingbot.com/appium/sample.apk',
    'tb:options' => array(
        'name' => 'My Test Name'
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "name": "My Test Name"
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "name": "My Test Name"
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "Galaxy S23";
appiumOptions.PlatformVersion = "13.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["name"] = "My Test Name"
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));
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).

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "Galaxy S23",
  "appium:platformVersion" => "13.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "build" => "My First Build"
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("Galaxy S23");
options.setPlatformVersion("13.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("build", "My First Build");
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'Android',
    'appium:automationName' => 'UiAutomator2',
    'appium:deviceName' => 'Galaxy S23',
    'appium:platformVersion' => '13.0',
    'appium:app' => 'https://testingbot.com/appium/sample.apk',
    'tb:options' => array(
        'build' => 'My First Build'
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "build": "My First Build"
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "build": "My First Build"
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "Galaxy S23";
appiumOptions.PlatformVersion = "13.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["build"] = "My First Build"
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));
Value Type
string

Idle Timeout

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

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "Galaxy S23",
  "appium:platformVersion" => "13.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "idletimeout" => 130
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("Galaxy S23");
options.setPlatformVersion("13.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("idletimeout", 130);
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'Android',
    'appium:automationName' => 'UiAutomator2',
    'appium:deviceName' => 'Galaxy S23',
    'appium:platformVersion' => '13.0',
    'appium:app' => 'https://testingbot.com/appium/sample.apk',
    'tb:options' => array(
        'idletimeout' => 130
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "idletimeout": 130
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "idletimeout": 130
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "Galaxy S23";
appiumOptions.PlatformVersion = "13.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["idletimeout"] = 130
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));
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.

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "Galaxy S23",
  "appium:platformVersion" => "13.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "maxduration" => 1800
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("Galaxy S23");
options.setPlatformVersion("13.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("maxduration", 1800);
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'Android',
    'appium:automationName' => 'UiAutomator2',
    'appium:deviceName' => 'Galaxy S23',
    'appium:platformVersion' => '13.0',
    'appium:app' => 'https://testingbot.com/appium/sample.apk',
    'tb:options' => array(
        'maxduration' => 1800
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "maxduration": 1800
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "maxduration": 1800
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "Galaxy S23";
appiumOptions.PlatformVersion = "13.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["maxduration"] = 1800
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));
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.

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "Galaxy S23",
  "appium:platformVersion" => "13.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "extra" => "Extra Information"
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("Galaxy S23");
options.setPlatformVersion("13.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("extra", "Extra Information");
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'Android',
    'appium:automationName' => 'UiAutomator2',
    'appium:deviceName' => 'Galaxy S23',
    'appium:platformVersion' => '13.0',
    'appium:app' => 'https://testingbot.com/appium/sample.apk',
    'tb:options' => array(
        'extra' => 'Extra Information'
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "extra": "Extra Information"
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "extra": "Extra Information"
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "Galaxy S23";
appiumOptions.PlatformVersion = "13.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["extra"] = "Extra Information"
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));
Value Type
string

Privacy and session recording

Capabilities for controlling screenshots, video recording, log capture and dashboard privacy.

Taking screenshots during your tests

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

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "Galaxy S23",
  "appium:platformVersion" => "13.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "screenshot" => true
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("Galaxy S23");
options.setPlatformVersion("13.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("screenshot", true);
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'Android',
    'appium:automationName' => 'UiAutomator2',
    'appium:deviceName' => 'Galaxy S23',
    'appium:platformVersion' => '13.0',
    'appium:app' => 'https://testingbot.com/appium/sample.apk',
    'tb:options' => array(
        'screenshot' => true
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "screenshot": True
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "screenshot": true
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "Galaxy S23";
appiumOptions.PlatformVersion = "13.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["screenshot"] = true
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));
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.
Video should not slow down your test considerably.

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "Galaxy S23",
  "appium:platformVersion" => "13.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "screenrecorder" => true
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("Galaxy S23");
options.setPlatformVersion("13.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("screenrecorder", true);
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'Android',
    'appium:automationName' => 'UiAutomator2',
    'appium:deviceName' => 'Galaxy S23',
    'appium:platformVersion' => '13.0',
    'appium:app' => 'https://testingbot.com/appium/sample.apk',
    'tb:options' => array(
        'screenrecorder' => true
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "screenrecorder": True
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "screenrecorder": true
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "Galaxy S23";
appiumOptions.PlatformVersion = "13.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["screenrecorder"] = true
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));
Value Type Default Value
boolean true

Test Privacy

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

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "Galaxy S23",
  "appium:platformVersion" => "13.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "public" => false
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("Galaxy S23");
options.setPlatformVersion("13.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("public", false);
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'Android',
    'appium:automationName' => 'UiAutomator2',
    'appium:deviceName' => 'Galaxy S23',
    'appium:platformVersion' => '13.0',
    'appium:app' => 'https://testingbot.com/appium/sample.apk',
    'tb:options' => array(
        'public' => false
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "public": False
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "public": false
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "Galaxy S23";
appiumOptions.PlatformVersion = "13.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["public"] = false
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));
Value Type Default Value
boolean false

Customize Logging

By default, TestingBot records logs of all test 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 Appium logs, Chromedriver logs, ...).

caps = {
  "platformName" => "Android",
  "appium:automationName" => "UiAutomator2",
  "appium:deviceName" => "Galaxy S23",
  "appium:platformVersion" => "13.0",
  "appium:app" => "https://testingbot.com/appium/sample.apk",
  "tb:options" => {
    "recordLogs" => true
  }
}

driver = Appium::Driver.new({
  caps: caps,
  appium_lib: { server_url: "https://api_key:api_secret@hub.testingbot.com/wd/hub" }
}, true).start_driver
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setAutomationName("UiAutomator2");
options.setDeviceName("Galaxy S23");
options.setPlatformVersion("13.0");
options.setApp("https://testingbot.com/appium/sample.apk");

MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("recordLogs", true);
options.setCapability("tb:options", tbOptions);

AndroidDriver driver = new AndroidDriver(
    new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = array(
    'platformName' => 'Android',
    'appium:automationName' => 'UiAutomator2',
    'appium:deviceName' => 'Galaxy S23',
    'appium:platformVersion' => '13.0',
    'appium:app' => 'https://testingbot.com/appium/sample.apk',
    'tb:options' => array(
        'recordLogs' => true
    )
);

$driver = RemoteWebDriver::create('https://api_key:api_secret@hub.testingbot.com/wd/hub', $capabilities);
from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "recordLogs": True
    }
}

options = UiAutomator2Options().load_capabilities(capabilities)
driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
const { remote } = require('webdriverio');

const capabilities = {
    "platformName": "Android",
    "appium:automationName": "UiAutomator2",
    "appium:deviceName": "Galaxy S23",
    "appium:platformVersion": "13.0",
    "appium:app": "https://testingbot.com/appium/sample.apk",
    "tb:options": {
        "key": "api_key",
        "secret": "api_secret",
        "recordLogs": true
    }
};

const driver = await remote({
    protocol: "https",
    hostname: "hub.testingbot.com",
    port: 443,
    path: "/wd/hub",
    capabilities
});
var appiumOptions = new AppiumOptions();
appiumOptions.PlatformName = "Android";
appiumOptions.AutomationName = "UiAutomator2";
appiumOptions.DeviceName = "Galaxy S23";
appiumOptions.PlatformVersion = "13.0";
appiumOptions.App = "https://testingbot.com/appium/sample.apk";

var tbOptions = new Dictionary<string, object>
{
    ["key"] = "api_key",
    ["secret"] = "api_secret",
    ["recordLogs"] = true
};
appiumOptions.AddAdditionalAppiumOption("tb:options", tbOptions);

var driver = new AndroidDriver(new Uri("https://hub.testingbot.com/wd/hub"),
    appiumOptions, TimeSpan.FromSeconds(600));
Value Type Default Value Possible Values:
string "true" true, false, or strip-parameters

Frequently asked questions

How do I select a specific device for my Appium test?

Set the appium:deviceName capability (for example "Pixel 9") plus platformName and appium:platformVersion. See the Device Name section for code snippets in Java, Python, Node.js, Ruby and C#.

How do I change the test name shown in the TestingBot dashboard?

Set name inside tb:options. See the Change Test Name section for examples per language.

How do I group multiple Appium tests under one build?

Set build inside tb:options with the same identifier across all tests. See the Group Tests section for examples.

What is the default Appium idle timeout on TestingBot?

120 seconds, plus a 15-second grace period. The session ends if no Appium command is received within that window. If you set appium:newCommandTimeout, TestingBot uses it as the idle timeout (up to 3600 seconds). Override with the idleTimeout capability inside tb:options, see the Idle Timeout section.

What is the default maximum Appium test duration?

1800 seconds (30 minutes). After that the session is terminated. Override with maxDuration inside tb:options, see the Maximum Test Duration section.

How do I attach custom metadata to my Appium test?

Pass a custom-data object inside tb:options. The dashboard and the REST API expose it back unchanged. See the Custom Metadata section.

Can I disable screenshots or screen recording for privacy?

Yes. Set screenshot: false and/or screenrecorder: false inside tb:options. For sensitive tests use the private capability to redact session metadata. See the Privacy section.

Can I change the timezone, locale or geolocation of the device?

Yes. Pass timeZone, appium:locale, appium:language or geoCountryCode inside the capability map. See the timezone section and geolocation section.

Was this page helpful?
Last updated