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.
- 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.
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");
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("app", "https://testingbot.com/appium/sample.ipa");
tbOptions = {
'name': 'W3C Sample',
'appiumVersion': "2.0"
}
chromeOpts = {
'app': "https://testingbot.com/appium/sample.ipa",
'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({
"app": 'https://testingbot.com/appium/sample.ipa',
"platformName": 'iOS',
"deviceName": 'iPhone 13',
"version": '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"
}
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
BrowserVersion = "16.0",
PlatformName = "iOS",
DeviceName = "iPhone 13",
App = "https://testingbot.com/appium/sample.ipa",
UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["appiumVersion"] = "2.0"
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), TimeSpan.FromSeconds(600));
Appium 2 Versions
We currently support these Appium 2 versions:
- 2.11.3
- 2.10.3
- 2.9.0
- 2.5.1
- 2.4.1
- 2.3.0
- 2.2.1
If you specify
"appiumVersion": "latest"
, TestingBot will automatically use the latest Appium version. You can also uselatest-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.
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);
MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("timeZone", "Etc/UTC");
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("app", "https://testingbot.com/appium/sample.apk");
driver = await new webdriver.Builder().withCapabilities({
"app": 'https://testingbot.com/appium/sample.apk',
"platformName": 'Android',
"goog:chromeOptions" : { "w3c" : true },
"tb:options": {
"key": "api_key",
"secret": "api_secret",
"timeZone": "Etc/UTC"
}
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
BrowserVersion = "81",
PlatformName = "Windows 10",
UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["timeZone"] = "Etc/UTC"
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), TimeSpan.FromSeconds(600));
Value Type | Default Value | Possible Values: |
---|---|---|
string | "Etc/UTC" | List of timezones |
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.
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);
MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("testingbot.geoCountryCode", "DE");
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("app", "https://testingbot.com/appium/sample.apk");
driver = await new webdriver.Builder().withCapabilities({
"app": 'https://testingbot.com/appium/sample.apk',
"platformName": 'Android',
"goog:chromeOptions" : { "w3c" : true },
"tb:options": {
"key": "api_key",
"secret": "api_secret",
"testingbot.geoCountryCode": "DE"
}
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
Version = "13.0",
PlatformName = "Android",
UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["testingbot.geoCountryCode"] = "DE"
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), 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
- 'BH': Bahrain
- 'BE': Belgium
- 'BR': Brazil
- 'CN': China
- 'FR': France
- 'DE': Germany
- 'IN': India
- 'IT': Italy
- 'JP': Japan
- 'SG': Singapore
- 'ZA': South Africa
- 'ES': Spain
- 'SE': Sweden
- '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:
- 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
).
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({
"app": 'https://testingbot.com/appium/sample.apk',
"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));
((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);
To stop network throttling during your test, pass
disable: true
in thetb:throttle
options via theexecute_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.
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");
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));
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:
Device Version
You can specify the version of the device you want to target. In case of physical devices, you might want to use regex/wildcard patterns to target a broad range of devices. This way your chance of hitting an occupied device during your automated test decreases significantly.
Instead of only targetting a specific iOS or Android device, you can target a wider range of devices.
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("appium:platformName", "Android");
caps.setCapability("appium:deviceName", "*");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("appium:version", "(13|14).*");
driver = await new webdriver.Builder().withCapabilities({
"browserName": 'chrome',
"appium:deviceName": '*',
"appium:version": '(13|14).*',
"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"
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["name"] = TestContext.CurrentContext.Test.Name,
["deviceName"] = "*"
["version"] = "(13|14).*"
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), TimeSpan.FromSeconds(600));
Some Examples:
// target multiple specific versions of an iPhone device
capabilities.setCapability("appium:deviceName", "iPhone.*");
capabilities.setCapability("appium:version", "18.0|15.0|14.2|14");
// find any Samsung device with Android version 13 or 14
capabilities.setCapability("appium:deviceName", "Samsung.*");
capabilities.setCapability("appium:version", "(13|14).*");
Tablet Only
You can specify this capability when you only want to allocate a tablet device.
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);
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.
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);
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));
Change Test Name
Add a name to this test, which will show up in the TestingBot member area and API.
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);
MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("name", "My Test Name");
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("app", "https://testingbot.com/appium/sample.apk");
driver = await new webdriver.Builder().withCapabilities({
"app": 'https://testingbot.com/appium/sample.apk',
"platformName": 'Android',
"goog:chromeOptions" : { "w3c" : true },
"tb:options": {
"key": "api_key",
"secret": "api_secret",
"name": "My Test Name"
}
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
Version = "13.0",
PlatformName = "Android",
UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["name"] = "My Test Name"
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), 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.
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);
MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("build", "My First Build");
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("app", "https://testingbot.com/appium/sample.apk");
tbOptions = {
'build': "My First Build"
}
chromeOpts = {
'app': "https://testingbot.com/appium/sample.apk",
'platformName': "Android",
'deviceName': "Galaxy S23",
'version': '13.0',
'goog:chromeOptions': {'w3c': True},
'tb:options': tbOptions
}
self.driver = webdriver.Remote(remote_url, desired_capabilities=chromeOpts)
driver = await new webdriver.Builder().withCapabilities({
"app": 'https://testingbot.com/appium/sample.apk',
"platformName": 'Android',
"goog:chromeOptions" : { "w3c" : true },
"tb:options": {
"key": "api_key",
"secret": "api_secret",
"build": "My First Build"
}
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
Version = "13.0",
PlatformName = "Android",
UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["build"] = "My First Build"
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), 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.
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);
MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("idletimeout", 130);
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("app", "https://testingbot.com/appium/sample.apk");
driver = await new webdriver.Builder().withCapabilities({
"app": 'https://testingbot.com/appium/sample.apk',
"platformName": 'Android',
"goog:chromeOptions" : { "w3c" : true },
"tb:options": {
"key": "api_key",
"secret": "api_secret",
"idletimeout": 130
}
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
Version = "13.0",
PlatformName = "Android",
UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["idletimeout"] = 130
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), TimeSpan.FromSeconds(600));
Value Type | Default Value |
---|---|
int (specify number of seconds) | 130 seconds |
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.
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);
MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("maxduration", 1800);
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("app", "https://testingbot.com/appium/sample.apk");
driver = await new webdriver.Builder().withCapabilities({
"app": 'https://testingbot.com/appium/sample.apk',
"platformName": 'Android',
"goog:chromeOptions" : { "w3c" : true },
"tb:options": {
"key": "api_key",
"secret": "api_secret",
"maxduration": 1800
}
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
Version = "13.0",
PlatformName = "Android",
UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["maxduration"] = 1800
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), 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.
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);
MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("extra", "Extra Information");
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("browserName", "chrome");
driver = await new webdriver.Builder().withCapabilities({
"app": 'https://testingbot.com/appium/sample.apk',
"platformName": 'Android',
"goog:chromeOptions" : { "w3c" : true },
"tb:options": {
"key": "api_key",
"secret": "api_secret",
"extra": "Extra Information"
}
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
Version = "13.0",
PlatformName = "Android",
UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["extra"] = "Extra Information"
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), TimeSpan.FromSeconds(600));
Value Type |
---|
string |
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.
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);
MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("screenshot", true);
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("app", "https://testingbot.com/appium/sample.apk);
driver = await new webdriver.Builder().withCapabilities({
"app": 'https://testingbot.com/appium/sample.apk',
"platformName": 'Android',
"goog:chromeOptions" : { "w3c" : true },
"tb:options": {
"key": "api_key",
"secret": "api_secret",
"screenshot": true
}
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
Version = "23",
PlatformName = "Android",
UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["screenshot"] = true
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), 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.
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);
MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("screenrecorder", true);
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("app", "https://testingbot.com/appium/sample.apk");
driver = await new webdriver.Builder().withCapabilities({
"app": 'https://testingbot.com/appium/sample.apk',
"platformName": 'Android',
"goog:chromeOptions" : { "w3c" : true },
"tb:options": {
"key": "api_key",
"secret": "api_secret",
"screenrecorder": true
}
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
Version = "13.0",
PlatformName = "Android",
UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["screenrecorder"] = true
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), 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.
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);
MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("public", false);
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("app", "https://testingbot.com/appium/sample.apk");
driver = await new webdriver.Builder().withCapabilities({
"app": 'https://testingbot.com/appium/sample.apk',
"platformName": 'Android',
"goog:chromeOptions" : { "w3c" : true },
"tb:options": {
"key": "api_key",
"secret": "api_secret",
"public": false
}
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
Version = "13.0",
PlatformName = "Android",
UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["public"] = false
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), 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, ...).
ChromeOptions chromeOpts = new ChromeOptions();
chromeOpts.setExperimentalOption("w3c", true);
MutableCapabilities tbOptions = new MutableCapabilities();
tbOptions.setCapability("key", "api_key");
tbOptions.setCapability("secret", "api_secret");
tbOptions.setCapability("recordLogs", true);
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
caps.setCapability("platformName", "Android");
caps.setCapability("tb:options", tbOptions);
caps.setCapability("app", "https://testingbot.com/appium/sample.apk");
driver = await new webdriver.Builder().withCapabilities({
"app": 'https://testingbot.com/appium/sample.apk',
"platformName": 'Android',
"goog:chromeOptions" : { "w3c" : true },
"tb:options": {
"key": "api_key",
"secret": "api_secret",
"recordLogs": true
}
}).usingServer("https://hub.testingbot.com/wd/hub").build();
var chromeOptions = new ChromeOptions()
{
Version = "13.0",
PlatformName = "Android",
UseSpecCompliantProtocol = true
};
var tbOptions = new Dictionary<string, object>
{
["key"] = "api_key",
["secret"] = "api_secret",
["recordLogs"] = true
};
chromeOptions.AddAdditionalCapability("tb:options", tbOptions, true);
driver = new RemoteWebDriver(new Uri("https://hub.testingbot.com/wd/hub"),
chromeOptions.ToCapabilities(), TimeSpan.FromSeconds(600));
Value Type | Default Value | Possible Values: |
---|---|---|
string | "true" |
true , false , or strip-parameters
|