Features

TestingBot API Documentation

TestingBot exposes a REST API which you can use to access or modify all your data, in a simple and secure way.
All API responses are in JSON format.

Our API endpoint is: https://api.testingbot.com
The most recent version: v1

API Clients

We have created open source client libraries to easily interact with our API:

List of browsers

This call will return a list of browsers our grid currently supports.

No authentication is required for this API call.

Copy code
curl "https://api.testingbot.com/v1/browsers"
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_browsers
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
ArrayList<TestingbotBrowser> browsers = restApi.getBrowsers();
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getBrowsers();
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.information.get_browsers()
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getBrowsers(function(error, browsers) {});
Optional Arguments:
  • (string) type - either "webdriver" or "rc"
Response:
Copy code
[{"selenium_name":"IE8","name":"iexplore","version":8,"platform":"WINDOWS","browser_id":1,"long_version":8},
{"selenium_name":"FF7","name":"firefox","version":7,"platform":"WINDOWS","browser_id":22,"long_version":7}]

Authentication

You can authenticate to our TestingBot API by providing your API key and API secret which you can obtain in the member area.

Authentication to the API needs to happen via HTTP Basic Auth.

All requests must be made to our endpoint via HTTP. You must authenticate for all API requests, except for List of browsers.

Access your user info

This call will return the data associated to your account.
You can edit this data by issueing a PUT request to our API.

Copy code
$ curl "https://api.testingbot.com/v1/user" \
-u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_user_info
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotUser user = restApi.getUserInfo();
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getUserInfo();
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.user.get_user_information()
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getUserInfo(function(error, userInfo) {});
Arguments:
None required
Response:
Copy code
{ 
    "first_name": "Steven",
    "last_name": "King",
    "seconds": 17745,
    "last_login" : "2024-12-22 15:47:41 UTC",
    "plan" : "small",
    "max_concurrent": 10,
    "max_concurrent_mobile": 2,
    "company":"companyName",
    "street":"companyStreet",
    "city":"companyCity",
    "country":"companyCountry",
    "vat":"ifInEurope"
}

Edit your user info

This call will return the data associated to your account.
You can edit this data by issueing a PUT request to our API.

Copy code
$ curl "https://api.testingbot.com/v1/user" \
-X PUT \
-d "user[first_name]=new" \
-u key:secret 
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.update_user_info({ "first_name" => 'new' })
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotUser user = restApi.updateUserInfo(TestingBotUser);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->updateUserInfo(array('first_name' => 'new'));
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.user.update_user_information()
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

const newUserData = {
    first_name: 'new'
}
api.updateUserInfo(newUserData, function(error, userInfo) {});
Arguments:
  • (string) first_name
  • (string) last_name
Response:
Copy code
{
    "success" : true,
    "user" : {
        "first_name": "new",
        "last_name": "King",
        "seconds": 17745,
        "last_login" : "2011-08-06T16:47:04Z"
    }
}

Get Team Info

If you are part of a team, you can fetch information regarding the team with this API call.
The response will include the maximum allowed concurrency for both VM based testing and physical mobile device testing.
Next to that, the response will include the current usage of the entire team, for both VM based testing and physical mobile device testing.

Copy code
$ curl "https://api.testingbot.com/v1/team-management" \
-u key:secret 
Response:
Copy code
{
    "concurrency":{
        "allowed":{
            "vms": 10,
            "physical": 2
        },
        "current":{
            "vms": 4,
            "physical": 1
        }
    }
}

Get users in your team

Retrieve all users that are part of your team.

Copy code
$ curl "https://api.testingbot.com/v1/team-management/users" \
-u key:secret 
Response:
Copy code
{
    "data":[
        {
            "id":337,
            "first_name":"test",
            "last_name":"user",
            "seconds":12000,
            "last_login":"2021-05-12T19:37:35.000Z",
            "plan":"Free Trial",
            "max_concurrent":2,
            "max_concurrent_mobile":2,
            "company":"",
            "street":"",
            "city":"",
            "country":"",
            "vat":null,
            "read_only":false,
            "roles":[],
            "current_vm_concurrency":0,
            "current_physical_concurrency":0
        }
    ],
    "meta":{
        "offset":0,
        "count":1,
        "total":1
    }
}

The roles field indicates if you have one of the roles in the team:

  • ADMIN

Retrieve a specific user in your team

Retrieve a specific user that is part of your team.

Copy code
$ curl "https://api.testingbot.com/v1/team-management/users/:id" \
-u key:secret 
Arguments:
  • (string) :id - a unique string identifying the user
Response:
Copy code
{
    "id":337,
    "first_name":"test",
    "last_name":"user",
    "seconds":12000,
    "last_login":"2021-05-12T19:37:35.000Z",
    "plan":"Free Trial",
    "max_concurrent":2,
    "max_concurrent_mobile":2,
    "company":"",
    "street":"",
    "city":"",
    "country":"",
    "vat":null,
    "read_only":false,
    "roles":[],
    "current_vm_concurrency":0,
    "current_physical_concurrency":0
}

The roles field indicates if you have one of the roles in the team:

  • ADMIN

Create a user in your team

Adds a new user to your team. You can use this API call to add TestingBot accounts for colleagues or people in your team.

Usage of this API call requires an upgraded account and ADMIN role.

Copy code
$ curl -X POST -u -u key:secret  \
https://api.testingbot.com/v1/team-management/users --header 'Content-Type: application/json' --data-raw '{
    "first_name": "Bruno",
    "last_name": "Mars",
    "email": "bmars@gmail.com",
    "password": "$bmaRs*RULES"
}'
Arguments:
  • (string) :first_name
  • (string) :last_name
  • (string) :email
  • (string) :password
Response:
Copy code
{
    "id":337,
    "first_name":"Bruno",
    "last_name":"Mars",
    "seconds":12000,
    "last_login":"2021-05-12T19:37:35.000Z",
    "plan":"Free Trial",
    "max_concurrent":2,
    "max_concurrent_mobile":2,
    "company":"",
    "street":"",
    "city":"",
    "country":"",
    "vat":null,
    "read_only":false,
    "roles":[],
    "current_vm_concurrency":0,
    "current_physical_concurrency":0
}

Update a user in your team

Updates details for a user in your team.

Usage of this API call requires an upgraded account and ADMIN role.

Copy code
$ curl -X PUT -u -u key:secret  \
https://api.testingbot.com/v1/team-management/users/:id --header 'Content-Type: application/json' --data-raw '{
    "first_name": "Bruno",
    "last_name": "Mars",
    "email": "bmars@gmail.com",
    "password": "$bmaRs*RULES"
}'
Arguments:
  • (string) :id
  • (string) :first_name
  • (string) :last_name
  • (string) :email
  • (string) :password
  • (string) :credits - how many credits (in seconds) this user for running tests on VMs
  • (string) :device_credits - how many credits (in seconds) this user for running tests on physical devices
  • (string) :concurrency - how many tests this user is able to run in parallel on VMs
  • (string) :concurrencyPhysical - how many tests this user is able to run in parallel on physical devices
Response:
Copy code
{
    "id":337,
    "first_name":"Bruno",
    "last_name":"Mars",
    "seconds":12000,
    "last_login":"2021-05-12T19:37:35.000Z",
    "plan":"Free Trial",
    "max_concurrent":2,
    "max_concurrent_mobile":2,
    "company":"",
    "street":"",
    "city":"",
    "country":"",
    "vat":null,
    "read_only":false,
    "roles":[],
    "current_vm_concurrency":0,
    "current_physical_concurrency":0
}

Reset credentials for a specific user in your team

This API call allows you to reset the secret credentials for a user in your team, which are required to connect to the TestingBot grid.

Usage of this API call requires an ADMIN role.

Copy code
$ curl -X POST -u -u key:secret  \
https://api.testingbot.com/v1/team-management/users/:id/reset-keys'
Arguments:
  • (string) :id
Response:
Copy code
{
    "success":true,
    "client_key":"d69e0800xc32ed2f059b7a630ee255b"
}

Only the client_key will be returned. The client_secret will also be reset, but will only be visible to the user in the member area.

Retrieve your tests

Will return all the tests you have created together with details for every test.
You can use the offset and count parameters to paginate your tests.

Copy code
$ curl "https://api.testingbot.com/v1/tests?offset=0&count=10" \
-u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_tests(0, 10)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotTest test = restApi.getTests(0, 10);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getJobs(0, 10);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.tests.get_tests(offset=0, limit=10)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getTests(function(error, tests) {}, offset, limit);
Arguments:
  • (int) offset (optional) (default 0) - paginate tests starting from this number
  • (int) count (optional) (default 10, max 500) - number of tests to fetch
  • (string) group (optional) - retrieve tests that belong to this group
  • (string) build (optional) - retrieve tests that belong to this build
  • (int) browser_id (optional) - retrieve tests that ran with this browser_id
  • (string) skip_fields (optional) - skip these fields. For example: ?skip_fields=logs,thumbs
Response:
Copy code
{
"data":[
    {
        "created_at":"2011-07-30T23:21:23Z",
        "completed_at":"2011-07-30T23:22:44Z",
        "extra":null,
        "id":3,
        "name":"MyTest::testTitle",
        "session_id":"f7903f9e93e74fe1b0e924bf9d2ce9fc",
        "status_message":"Failed asserting that 1 equals 0.",
        "device_name": null,
        "platform_name": null,
        "status_id": 1,
        "success":false,
        "test_environment_id":1,
        "thumbs":[],
        "video":"https://s3.amazonaws.com/rectestingbot/sample.mp4",
        "groups":["testingbot.com"],
        "browser":"IE8",
        "browser_version":8,
        "os":"WINDOWS",
        "duration":13,
        "build":"buildid",
        "logs":{"vm":"https://s3-eu-west-1.amazonaws.com/eulogtestingbot/session.txt"}
    }
],
"meta":
    {
        "offset":2,
        "count":3,
        "total":789
    }
}
Possible errors:
  • 404 Not found - test not found

Specific test info

This call will return info for one of your tests.
In the example below, the response will contain info for a test with Selenium sessionId 3.

You can fetch all the various test sessionIds that belong to you by fetching your tests.

Copy code
$ curl "https://api.testingbot.com/v1/tests/:webdriver_session_id" -u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_test(webdriver_session_id)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotTest test = restApi.getTest(String webdriver_session_id);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getJob($webdriver_session_id);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.tests.get_test(webdriver_session_id)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getTestDetails(webdriver_session_id, function(error, testDetails) {});
Arguments:
  • (string) :webdriver_session_id - a unique string identifying your test (= Selenium sessionId)
  • (string) skip_fields (optional) - skip these fields. For example: ?skip_fields=logs,thumbs
Response:
Copy code
{
    "created_at":"2011-07-30T23:21:23Z",
    "completed_at":"2011-07-30T23:22:23Z",
    "extra":null,
    "id":3,
    "name":"MyTest::testTitle",
    "session_id":"f7903f9e93e74fe1b0e924bf9d2ce9fc",
    "status_message":"Failed asserting that 1 equals 0.",
    "device_name": null,
    "platform_name": null,
    "success":false,
    "state":"COMPLETE",
    "unknown":false,
    "thumbs":["https://s3.amazonaws.com/euthumbtestingbot/3_f93782fji.jpg"],
    "video":"https://s3.amazonaws.com/eurectestingbot/sample.mp4",
    "logs": {"selenium":"https://s3-eu-west-1.amazonaws.com/eulogtestingbot/session.txt"},
    "groups":["testingbot.com"],
    "build": null,
    "browser":"IE8",
    "browser_version": 8,
    "os":"VISTA",
    "duration":60,
    "type":"WEBDRIVER",
    "assets_available": true,
    "steps": [
        {
             "command":"/session",
             "arguments":"{\"capabilities\":{\"alwaysMatch\":{\"browserName\":\"chrome\",\"version\":\"108\"},\"firstMatch\":[{}]},\"desiredCapabilities\":{\"platform\":\"WIN8\",\"browserName\":\"chrome\",\"version\":\"108\"}}",
             "response":"cb7503d4b57a-1df17d3a749a-bb324331da31-167601846491-06317943",
             "time":1676018469521
        }
    ]
}
Possible errors:
  • 404 Not found - test not found

Update a test

This call will update a test.
You can use this call to update the success status, add a name or extra data, ...

To update a specific test, pass its unique test ID or its Selenium session ID.

Copy code
$ curl "https://api.testingbot.com/v1/tests/:webdriver_session_id" \
-X PUT \
-d "test[success]=1" \
-u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
@api.update_test(webdriver_session_id, { :name => new_name, :success => true })
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
boolean success = restApi.updateTest(String webdriver_session_id, Map<String, Object> details);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->updateJob($webdriver_session_id, array('name' => 'mytest', 'success' => true));
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.tests.update_test(webdriver_session_id, status_message=.., passed=1|0, build=.., name=..)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});
const testData = { "test[success]" : "1", "test[status_message]" : "test" };
api.updateTest(testData, webdriver_session_id, function(error, testDetails) {});
Arguments:
  • (string) id - a unique string identifying your test (= Selenium sessionId, a UUID)
  • (boolean) test[success] - indicating if the test was successful
  • (string) test[status_message] - the status/error message of your test
  • (string) test[name] - the name of your test
  • (string) test[extra] - extra data for this test
  • (string) groups=...,... - a comma-separated string of groups for this test
  • (string) build=... - what build this test belongs to
Response:
Copy code
{
    "success" : true
}
Possible errors:
  • 404 Not found - test not found

Delete test

Will delete a specific test, together with possible thumbnails.
In the example below, we'll delete a test with id 3.

You can fetch all the various test ids that belong to you by fetching your tests.

Copy code
$ curl "https://api.testingbot.com/v1/tests/:webdriver_session_id" \
-X DELETE \
-u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.delete_test(webdriver_session_id)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
boolean success = restApi.deleteTest(String webdriver_session_id);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->deleteJob($webdriver_session_id);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.tests.delete_test(webdriver_session_id)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.deleteTest(webdriver_session_id, function(error, success) {});
Arguments:
  • (string) id - a unique identifier identifying your test
Response:
Copy code
{
    "success":true
}
Possible errors:
  • 404 Not found - test not found

Stop test

Will terminate the running test job.
This will end the test and mark the test as completed.
Any test assets and metadata gathered will be available for download.

Copy code
$ curl "https://api.testingbot.com/v1/tests/:session_id/stop" \
-X PUT \
-u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.stop_test(session_id)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
boolean success = restApi.stopTest(String session_id);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->stopJob($session_id);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.tests.stop_test(session_id)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.stopTest(webdriver_session_id, function(error, success) {});
Arguments:
  • (string) :session_id - a unique number identifying your test
Response:
Copy code
{
    "success":true
}
Possible errors:
  • 404 Not found - test not found

Retrieve all builds

Will retrieve all builds for your account.
A build is a group of tests.

Copy code
$ curl "https://api.testingbot.com/v1/builds?offset=0&count=10" \
-u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_builds(0, 10)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotBuildCollection builds = restApi.getBuilds(int offset, int count);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getBuilds(0, 10);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.build.get_builds(offset=0, limit=10)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getBuilds(function(error, builds) {}, offset, limit);
Arguments:
  • (int) offset (optional) (default 0) - paginate tests starting from this number
  • (int) count (optional) (default 10, max 500) - number of tests to fetch

Response:
Copy code
{
"data":[
    {
        "id" : 4331,
        "build_identifier" : "first-build",
        "created_at" : "2016-08-01T11:09:02.000Z",
        "updated_at" : "2016-08-01T11:09:02.000Z"
    }
],
"meta":{
        "offset" : 0,
        "count" : 10,
        "total" : 3
    }
}

Tests for a build

Will return all tests for a single build.


Copy code
$ curl "https://api.testingbot.com/v1/builds/:buildId" \
-u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_build(build_identifier)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotTestBuildCollection tests = restApi.getTestsForBuild(String buildId);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getBuild($buildId);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.build.get_tests_for_build(buildId)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getTestsForBuild(buildId, function(error, tests) {});

Arguments:
  • (string) buildId - a unique string describing the build

Response:
Copy code
{
"data":[
    {
        "created_at":"2011-07-30T23:21:23Z",
        "completed_at":"2011-07-30T23:22:44Z",
        "extra":null,
        "id":3,
        "name":"MyTest::testTitle",
        "session_id":"f7903f9e93e74fe1b0e924bf9d2ce9fc",
        "status_message":"Failed asserting that 1 equals 0.",
        "success":false,
        "thumbs":[],
        "video":"https://s3.amazonaws.com/rectestingbot/sample.mp4",
        "groups":["testingbot.com"],
        "browser":"IE8",
        "browser_version":8,
        "os":"WINDOWS",
        "duration":13,
        "build":"buildid",
        "logs":{"browser":"https://s3-eu-west-1.amazonaws.com/eulogtestingbot/session.txt"},
        "assets_available": true
    }
]
}

Delete a build

Will delete a build. Does not delete the tests in the build.


Copy code
$ curl "https://api.testingbot.com/v1/builds/:buildId" \
-X DELETE \
-u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.delete_build(build_identifier)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotUser user = restApi.deleteBuild(String buildId);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->deleteBuild($buildId);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.build.delete_build(buildId)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.deleteBuild(buildId, function(error, success) {});

Arguments:
  • (string) buildId - a unique string describing the build

Response:
Copy code
{
    "successs": true
}

Retrieve all Devices

Will fetch all Real Mobile devices, including devices currently in use.
The response will include all public devices, and private devices associated to your subscription (if any).


Copy code
$ curl -u key:secret "https://api.testingbot.com/v1/devices"
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_devices()
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotUser user = restApi.getDevices(int offset, int count);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getDevices();
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.information.get_devices()
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getDevices(function(error, devices) {});

Response:
Copy code
[{
    "id":1,
    "available":true,
    "model_number":"SM-G950U1",
    "resolution":"1080x2220",
    "width":1080,
    "height":2220,
    "cpu":"Octa-core (4x2.3 GHz Mongoose M2 & 4x1.7 GHz Cortex-A53)",
    "name":"Galaxy S8",
    "platform_name":"Android",
    "free_trial": true,
    "version":"9.0",
    "multiple_browsers":[
        {
            "id":1727,
            "name":"chrome",
            "version":"103.0.5060.129"
        },
        {
            "id":2133,
            "name":"firefox",
            "version":"98.2"
        },
        {
            "id":2953,
            "name":"samsung",
            "version":"13.2.1.70"
        },
        {
            "id":2954,
            "name":"opera",
            "version":"67.1"
        }
    ]
},
{
    "id":5,
    "available":false,
    "model_number":"MRY42B/A",
    "resolution":"828x1792",
    "width":828,
    "height":1792,
    "cpu":"ARM - Single-core - 2390Mhz",
    "name":"iPhone XR",
    "version":"16.3",
    "platform_name":"iOS",
    "free_trial": false
}]

Retrieve all Available Devices

Will fetch all available Real Mobile devices.
The response will include all public devices, and private devices associated to your subscription (if any).


Copy code
% curl -u key:secret "https://api.testingbot.com/v1/devices/available"
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_available_devices()
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotUser user = restApi.getAvailableDevices(int offset, int count);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getAvailableDevices();
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.information.get_available_devices()
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getAvailableDevices(function(error, availableDevices) {});

Response:
Copy code
[{
    "id":1,
    "available":true,
    "model_number":"SM-G950U1",
    "resolution":"1080x2220",
    "width":1080,
    "height":2220,
    "cpu":"Octa-core (4x2.3 GHz Mongoose M2 & 4x1.7 GHz Cortex-A53)",
    "name":"Galaxy S8",
    "platform_name":"Android",
    "free_trial": true,
    "version":"9.0",
    "multiple_browsers":[
        {
            "id":1727,
            "name":"chrome",
            "version":"103.0.5060.129"
        },
        {
            "id":2133,
            "name":"firefox",
            "version":"98.2"
        },
        {
            "id":2953,
            "name":"samsung",
            "version":"13.2.1.70"
        },
        {
            "id":2954,
            "name":"opera",
            "version":"67.1"
        }
    ]
},
{
    "id":5,
    "available":true,
    "model_number":"MRY42B/A",
    "resolution":"828x1792",
    "width":828,
    "height":1792,
    "cpu":"ARM - Single-core - 2390Mhz",
    "name":"iPhone XR",
    "version":"16.3",
    "platform_name":"iOS",
    "free_trial": false
}]

Device Detail

Retrieves details for a single device.


Copy code
$ curl "https://api.testingbot.com/v1/devices/:id" \
-u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_device(device_identifier)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotUser user = restApi.getDevice(int deviceId);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getDevice($deviceId);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.information.get_device(deviceId)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getDevice(deviceId, function(error, devices) {});

Arguments:
  • (number) id - the numeric id retrieved from the devices list.

Response:
Copy code
{
    "id":12,
    "available":true,
    "model_number":"E",
    "resolution":"1440x3200",
    "width":1440,
    "height":3200,
    "cpu":"ARM - Quad-core - 1593Mhz",
    "name":"Galaxy S20",
    "platform_name":"Android",
    "free_trial": false,
    "version": "10.0",
    "multiple_browsers":[
        {"id":2598,"name":"chrome","version":"101"},
        {"id":2919,"name":"firefox","version":"98.2"},
        {"id":2957,"name":"samsung","version":"13.2.1.70"},
        {"id":2958,"name":"opera","version":"67.1"}
    ]
}

Take Screenshots

With this API call you can request TestingBot to take screenshots of a specific URL with the browsers you specify.

Important: Please specify the application/json Content-Type header and specify the post body as JSON.


Copy code
$ curl -H 'Content-Type: application/json' -X POST "https://api.testingbot.com/v1/screenshots" \
-u key:secret \
-d '{"url":"https://www.google.com", "resolution" : "1280x1024", "browsers" : [{ "browserName" : "chrome", "version" : 61, "os" : "SIERRA"}, { "browserName" : "safari", "version" : 11, "os" : "HIGH-SIERRA"}]}'

Arguments:
  • (string) url - the URL of the page you'd like to take screenshots of
  • (string) resolution - the screenresolution of the OS:
    • 800x600
    • 1024x768
    • 1280x960
    • 1280x1024
    • 1600x1200
    • 1920x1200
    • 2560x1440
  • (string) callback_url (optional) - when the screenshots are taken, we can send a JSON formatted post to the callback URL you specify. The JSON body will be identical to the response of the Retrieve Screenshots API call
  • (boolean) full_page (optional) - by default we take a screenshot of the viewport. If you'd like a screenshot of the entire page, set this to 'true'.
  • (int) wait_time (optional) (default 0) - the time (in seconds) to wait between page load and taking the screenshots
  • (string) browsers - a list of browsers with keys:
    • (string) browserName - the name of the browser (internet explorer, chrome, safari, firefox, ...)
    • (string) version - the version of the browser you require
    • (string) os - the OS where the test should run

Response:
Copy code
{ "id" : 3454, "wait_time" : 0, "resolution" : "1280x1024", "url" : "https://www.google.com" }

Retrieve Screenshots

Specify the id of the take screenshot call to query the progress of the screenshots.


Copy code
$ curl "https://api.testingbot.com/v1/screenshots/:id" -u key:secret

Arguments:
  • (int) id - the id of the screenshot group

Response:
Copy code
{
    "state":"done",
    "screenshots":[
        {
            "image_url":"https://....",
            "thumb_url":"https://....",
            "state":"done",
            "id":"9c7deea4-6f23-4041-842b-39cccee447fa",
            "created_at":"2017-10-13T14:47:44.000Z",
            "os":"SIERRA",
            "browser_name":"googlechrome",
            "browser_version":"61",
            "browser_id":1146,
            "device_name":null,
            "platform_name":""
        }
    ]
}

  • (string) state - represents the current state for screenshot job. Values can be:
    • processing: Not all screenshots have been taken yet.
    • done: All screenshots are available and can be accessed.
    • error: Something went wrong while trying to take the screenshots.
    • stopped: The process of taking the screenshots was stopped by manually clicking the 'stop' button in our UI.
  • The screenshots object itself:
    • (string) image_url - location to the actual screenshot (png format)
    • (string) thumb_url - 100x100 thumb of the actual screenshot
    • (string) state - represents the current state for the screenshot. Values can be:
      • processing: The screenshot has not been taking yet, the test is either queued or running.
      • done: The screenshot has been taken and has been uploaded to our cloud - you can now view the screenshot via image_url or thumb_url.
      • error: Something went wrong while trying to take the screenshot.
      • stopped: The process of taking the screenshot was stopped before a screenshot was taken. This can only be done by manually clicking the 'stop' button in our UI.
    • (string) id - a unique identifier for this screenshot

Screenshot history

Retrieves a list of previous screenshot jobs.


Copy code
$ curl "https://api.testingbot.com/v1/screenshots" -u key:secret

This will return a list of screenshot jobs. You can use the id of every job to fetch the screenshots for this job.

Arguments:
  • (int) offset (optional) (default 0) - paginate screenshot jobs starting from this number
  • (int) count (optional) (default 10, max 500) - number of screenshot jobs to fetch

Response:
Copy code
{
    "data" : [
        {
            "id":3454,
            "url":"https://google.com",
            "resolution":"1280x1024"
        },
        {
            "id":3452,
            "url":"https://testingbot.com",
            "resolution":"1280x1024"
        },
        {
            "id":3451,
            "url":"https://yahoo.com",
            "resolution":"1280x1024"
        }
    ],
    "meta":{
        "offset" : 0,
        "count" : 3,
        "total" : 3
    }
}

TestingBot Tunnel List

List of currently active TestingBot Tunnels for your account.


You can have up to 3 simultaneous tunnels running with your account.
By issuing a DELETE request you can delete/stop any of your tunnels.


Copy code
$ curl "https://api.testingbot.com/v1/tunnel/list" \
-u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_tunnels
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
ArrayList<TestingbotTunnel> tunnels = restApi.getTunnels();
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getTunnels();
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.tunnel.get_tunnels()
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getTunnelList(function(error, tunnelList) {});

Response:
Copy code
[
    { 
        "ip":"xx",
        "private_ip":"xx",
        "state":"READY",
        "id":1,
        "requested_at"=>"2013-04-23 01:34:23"
    }
]

TestingBot Tunnel Delete

Delete an active TestingBot Tunnel in your account.


Usually the tunnel jar will issue this call automatically when you gracefully exit the jar.
You can also use this API call, which destroys the tunnel VM.


Copy code
$ curl "https://api.testingbot.com/v1/tunnel/:id" \
-X DELETE \
-u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.delete_tunnel(tunnel_identifier)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
boolean success = restApi.deleteTunnel(String tunnelId);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->deleteTunnel($tunnelID);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.tunnel.delete_tunnel(tunnelId)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.deleteTunnel(tunnelId, function(error, success) {});

Response:
Copy code
{ 
    "success":true
}

List Lab tests

Will return a list with all the tests in our TestLab.
In our TestLab you can upload Selenium tests, which you can then execute with a cron or by creating an API request.

Copy code
$ curl "https://api.testingbot.com/v1/lab" \
-u key:secret
Arguments:
  • (int) offset (optional) (default 0) - paginate tests starting from this number
  • (int) count (optional) (default 10, max 500) - number of tests to fetch

Response:
Copy code
{
"data":[
{ 
    "id":215,
    "enabled":false,
    "alerts":[],
    "url":"https://testingbot.com/",
    "name":"testingbot",
    "created_at":"2012-03-12T20:03:45Z",
    "updated_at":"2012-03-13T20:26:43Z",
    "last_run":"2012-03-13T06:50:48Z",
    "cron":"0 0 * * *",
    "browsers":[
        {"name":"firefox","version":10,"os":"LINUX"}
    ]
}],
"meta":
    {
        "offset":2,
        "count":3,
        "total":25
    }
}

Specific Lab test info

This call will return info for a specific TestLab test.
In the example below, the response will contain info for a test with id 215.

Copy code
$ curl "https://api.testingbot.com/v1/lab/215" \
-u key:secret
Arguments:
  • (int) id - a unique identifier identifying your test in the TestLab

Response:
Copy code
{ 
    "id":215,
    "enabled":false,
    "alerts":[],
    "url":"https://testingbot.com/",
    "name":"testingbot",
    "created_at":"2012-03-12T20:03:45Z",
    "updated_at":"2012-03-13T20:26:43Z",
    "last_run":"2012-03-13T06:50:48Z",
    "cron":"0 0 * * *",
    "browsers":[
        {"name":"firefox","version":10,"os":"LINUX"}
    ]
}
Possible errors:
  • 404 Not found - lab test not found

Create a Lab Test

Create a lab Test


Copy code
$ curl -X POST "https://api.testingbot.com/v1/lab" \
-u key:secret -d "test[name]=test" -d "test[cron]=31 * * * *"

Arguments:
  • (string) test[name] - name of the test * required argument
  • (string) test[url] - url to test * required argument
  • (string) test[cron] - cron format, when to run the test
  • (boolean) test[screenshot] - take screenshots
  • (boolean) test[video] - record video
  • (int) test[idletimeout] - how long we keep a test open without receiving a request
  • (string) test[screenresolution] - screenresolution of the OS

Upload .side file

You can also upload a .side file to the TestingBot REST-API to immediately create a test and upload all steps from the file.

Copy code
$ curl -X POST "https://api.testingbot.com/v1/lab" \
-u key:secret -F "test[name]=test" -F "test[cron]=31 * * * *" -F "file=@/Users/{yourName}/example.side"

Arguments:
  • (string) test[name] - name of the test * required argument
  • (File) filepath - to the .side file on your machine * required argument
  • (string) test[cron] - cron format, when to run the test
Response:
Copy code
[{"success":true, "lab_test_id": 59392}]

Delete Lab test

This call will delete a specific TestLab test.

Copy code
$ curl "https://api.testingbot.com/v1/lab/215" \
-X DELETE \
-u key:secret
Arguments:
  • (string) id - a unique identifier identifying your test in the TestLab

Response:
Copy code
{ 
    "success":true
}
Possible errors:
  • 404 Not found - lab test not found

Update Lab test

This call will update a specific TestLab test.

Copy code
$ curl "https://api.testingbot.com/v1/lab/215" \
-X PUT \
-d "test[cron]=* * * * *" \
-u key:secret
Arguments:
  • (string) id - a unique identifier identifying your test in the TestLab
  • (string) url
  • (string) name
  • (string) cron
  • (boolean) enabled

Response:
Copy code
{ 
    "success":true
}
Possible errors:
  • 404 Not found - lab test not found

Lab Test Schedule

Add or update the Lab Test Schedule. You can schedule when/at which interval a test should be run.

Copy code
$ curl "https://api.testingbot.com/v1/lab/215/schedule" \
-X POST \
-d "type=once" \
-d "day=2020-03-01" \
-d "hour=00:00" \
-u key:secret
Arguments:
  • (string) type once, daily, weekly, custom (cron format)
  • (string) day 2020-03-01 for example (to be used with 'once' or 'weekly')
  • (string) hour 00:01 for example (to be used with 'once', 'daily' or 'weekly')
  • (string) cronFormat */5 * * * * for example (cron format)

Response:
Copy code
{ 
    "success":true
}
Possible errors:
  • 404 Not found - lab test not found
The callback URL will receive these (post data) parameters:
Copy code
'success' => success (boolean),
'job_id' => job_id,
'test_ids[]' => [test_ids],
'session_ids[]' => [session_ids]
'errors[]' => json encoded errors

Lab Test Alert

Add or update the Lab Test Alert. You can receive an alert via e-mail, Webhook or SMS message.

Copy code
$ curl "https://api.testingbot.com/v1/lab/215/alert" \
-X POST (or PUT for update) \
-d "kind=EMAIL" \
-d "level=IMMEDIATELY" \
-d "content=my@email.com" \
-u key:secret
Arguments:
  • (string) kind EMAIL, API or SMS
  • (string) level IMMEDIATELY or DAILY
  • (string) content the email address, telephone number or callback URL

Response:
Copy code
{ 
    "success":true
}
Possible errors:
  • 404 Not found - lab test not found
The callback URL will receive these (post data) parameters:
Copy code
'success' => success (boolean),
'job_id' => job_id,
'test_ids[]' => test_ids
'errors[]' => json encoded errors

Lab Test Report

Add or update the Lab Test Report setting. You can receive a daily report about your test success/fail rate.

Copy code
$ curl "https://api.testingbot.com/v1/lab/215/report" \
-X POST (or PUT for update) \
-d "email=my@email.com" \
-d "cron=*/5 * * * *" \
-u key:secret
Arguments:
  • (string) email the email address to contact
  • (string) cron a cron format

Response:
Copy code
{ 
    "success":true
}
Possible errors:
  • 404 Not found - lab test not found

Modify Test Steps

Update the steps for this test. Will remove all steps and add the steps you specify.

Copy code
$ curl "https://api.testingbot.com/v1/lab/215/steps" \
-X POST \
-d "steps[][cmd]=open" \
-d "steps[][locator]=/" \
-d "steps[][value]=" \
-d "steps[][order]=0" \
-u key:secret
Arguments:
  • (string) step[cmd] - Selenium RC command
  • (int) step[order] - Define where this step should be located in the list of steps
  • (string) step[locator] - Selenium RC locator
  • (string) step[value] - Selenium RC value

Response:
Copy code
{ 
    "success":true
}
Possible errors:
  • 404 Not found - lab test not found

List Test Steps

This will return all steps for a specific Lab Test.

Copy code
$ curl -u key:secret "https://api.testingbot.com/v1/lab/215/steps"
Arguments:
  • (int) offset (optional) (default 0) - paginate steps starting from this number
  • (int) count (optional) (default 10, max 500) - number of steps to fetch

Response:
Copy code
{
    "data": [{
            "test_order": 0,
            "cmd": "open",
            "locator": "/",
            "value": "",
            "created_at": "2019-05-02T14:33:48.000Z",
            "updated_at": "2019-05-02T14:33:48.000Z"
        },
        {
            "test_order": 1,
            "cmd": "type",
            "locator": "id=username",
            "value": "test",
            "created_at": "2019-05-02T14:33:48.000Z",
            "updated_at": "2019-05-02T14:33:48.000Z"
        },
        {
            "test_order": 2,
            "cmd": "type",
            "locator": "id=password",
            "value": "test",
            "created_at": "2019-05-02T14:33:48.000Z",
            "updated_at": "2019-05-02T14:33:48.000Z"
        }
    ],
    "meta": {
        "offset": 0,
        "count": 3,
        "total": 3
    }
}
Possible errors:
  • 404 Not found - lab test not found

Get Browsers for Test

Retrieve what browsers this Lab Test will run on.


Copy code
$ curl "https://api.testingbot.com/v1/lab/:suiteId/browsers" \
-u key:secret

Arguments:
  • (int) suiteId - unique Id for this suite
Response:
Copy code
[{"name":"firefox","version":"41","os":"VISTA"}]

Update Browsers for Test

Update a Lab Test, indicate on which browsers the test should run.
This call will override all existing browsers attached to this test.


Copy code
$ curl -X POST "https://api.testingbot.com/v1/lab/:suiteId/browsers" \
-u key:secret -d "browser_ids=515,518
Arguments:
  • (int) suiteId - unique Id for this suite
  • (string) browser_ids - (comma-seperated list) - list of all browser_ids to add to this test

You can get the browser_ids by using the List of browsers call and use the browser_ids in that response.

Response:
Copy code
{"success":true}

Run a specific Lab test

This call will run a specific TestLab test on our grid.
Upload a Selenium test in our TestLab, indicate on which browsers you want it to run and then run the test with this API call.


You could use this call to run tests when you wish, for example before/after deployment of your code.
Since this call is asynchronously (test takes too long to be processed during the API call), you need to specify an API callback page in the alert section of your TestLab test.


This call will return a success state and a job_id, which you can use to query the progress of the test.

Copy code
$ curl "https://api.testingbot.com/v1/lab/215/trigger" \
-X POST \
-d "" \
-u key:secret
Arguments:
  • (int) testid - a unique number identifying your test in the TestLab
  • (string) url (optional) - change the baseURL for this test

Response:
Copy code
{ 
    "success":true,
    "job_id" : 14
}
Possible errors:
  • 404 Not found - lab test not found

Stop a specific Lab test

This call will stop a specific TestLab test currently running on our grid.


As soon as we receive this call, we will no longer continue running the remaining steps in the running Lab test.

Copy code
$ curl "https://api.testingbot.com/v1/lab/:testid/stop" \
-X PUT \
-u key:secret
Arguments:
  • (int) testid - a unique number identifying your test in the TestLab
  • (int) browser_id (optional) - a browser_id to only stop the test for this browser

Response:
Copy code
{ 
    "success":true
}
Possible errors:
  • 404 Not found - lab test not found

Run all Lab tests

This call will run all TestLab tests on our grid.


This call will return a success state and a job_id, which you can use to query the progress of the tests.

Copy code
$ curl "https://api.testingbot.com/v1/lab/trigger_all" \
-X POST \
-d "" \
-u key:secret

Arguments:
  • (string) url (optional) - change the baseURL for this test
Response:
Copy code
{ 
    "success":true,
    "job_id" : 14
}

Test Job

This call will return the status of a running test or suite, initiated by an API call.


Copy code
$ curl "https://api.testingbot.com/v1/jobs/:jobId" \
-u key:secret
Arguments:
  • (int) :jobId - a unique number identifying your job

Response:
Copy code
{  
    "status":"FINISHED",
    "created_at":"2016-04-15T13:47:39.000Z",
    "updated_at":"2016-04-15T13:49:30.000Z",
    "success":false,
    "test_ids":[  
      6620446
    ],
    "errors":[  
      {  
         "msg":"Actual value 'Google' did not match 'Goooogle'",
         "step":"verifyTitle",
         "browser":{  
            "name":"firefox",
            "version":"43",
            "os":"VISTA"
         },
         "time":"2016-04-15T13:48:25.839Z",
         "test":6620446
      }
    ]
}

The various states are: WAITING, RUNNING and FINISHED.

Possible errors:
  • 404 Not found - job not found

Webhook

If you initiated an API call running one or all tests, you will want to know the results of the test(s).

We post the result of the test(s) back to the location you specified in our TestLab (alerts section).


Sample post data:
Copy code
{
    "success":"false",
    "errors":[
        { 
          "msg" : "word Not found", 
          "step" : "verifyTextPresent", 
          "browser" : { 
            "name" : "iexplore", 
            "version" : "8", 
            "os" : "WINDOWS"
           },
           "time" : "2012-03-13 20:34:59 UTC", 
           "test_id" : "48586",
           "job_id": 17,
           "lab_id" : 133
        }
    ],
    "job_id":3,
    "test_ids":[48586]
}

Copy code
{
    "success":"true",
    "test_ids":[48586, 48587],
    "job_id":3
}

List Lab Suites

Get a list of all Lab Suites currently available for your account in the TestLab.


Copy code
$ curl "https://api.testingbot.com/v1/labsuites?offset=0&count=10" \
-u key:secret
Arguments:
  • (int) offset (optional) (default 0) - paginate suites starting from this number
  • (int) count (optional) (default 10, max 500) - number of suites to fetch

Response:
Copy code
{
    "data": [
    {
      "id": 1051,
      "enabled": true,
      "alerts": [
        {
          "type": "API",
          "value": "https:\/\/mysite.com\/callback\/",
          "level": "IMMEDIATELY"
        }
      ],
      "name": "Example",
      "created_at": "2017-03-07T19:11:41.000Z",
      "updated_at": "2017-03-09T12:17:22.000Z",
      "last_run": "2017-03-09T12:17:22.000Z",
      "cron": null,
      "browsers": [
        {
          "name": "firefox",
          "version": "41",
          "os": "VISTA"
        }
      ],
      "test_count": 5
    }
    ],
    "meta": {
    "offset": 0,
    "count": 10,
    "total": 1
    }
}

Specific Lab Suite

Get information about a specific Lab Suite.


Copy code
$ curl "https://api.testingbot.com/v1/labsuites/:suiteId" \
-u key:secret
Arguments:
  • (int) suiteId - unique Id for this suite
Response:
Copy code
{
    "enabled": true,
    "alerts": [
    {
      "type": "API",
      "value": "https:\/\/mysite.com\/callback\/",
      "level": "IMMEDIATELY"
    }
    ],
    "name": "Example",
    "created_at": "2017-03-07T19:11:41.000Z",
    "updated_at": "2017-03-09T12:17:22.000Z",
    "last_run": "2017-03-09T12:17:22.000Z",
    "cron": null,
    "test_count": 5
}

Run a specific Lab suite

This call will run a specific TestLab suite on our grid.
Upload a Selenium suite in our TestLab, indicate on which browsers you want it to run and then run the suite with this API call.


You could use this call to run suites when you wish, for example before/after deployment of your code.
Since this call is asynchronously (suite takes too long to be processed during the API call), you need to specify an API callback page in the alert section of your TestLab suite.


This call will return a success state and a job_id, which you can use to query the progress of the test.

Copy code
$ curl "https://api.testingbot.com/v1/labsuites/:suiteId/trigger" \
-X POST \
-d "" \
-u key:secret
Arguments:
  • (int) :suiteId - a unique number identifying your suite in the TestLab

Response:
Copy code
{ 
    "success":true,
    "job_id" : 14
}
Possible errors:
  • 404 Not found - lab test not found

Create a Lab Suite

Create a lab suite


Copy code
$ curl -X POST "https://api.testingbot.com/v1/labsuites" \
-u key:secret -d "suite[name]=test" -d "suite[cron]=31 * * * *"

Arguments:
  • (string) suite[name] - name of the suite.
  • (string) suite[cron] - cron format, when to run the suite.
  • (boolean) suite[screenshot] - take screenshots for every step.
  • (boolean) suite[video] - record video of this test.
  • (int) suite[idletimeout] - how long before we consider a test to be idle.
  • (string) suite[screenresolution] - screenresolution of the OS.
Response:
Copy code
[{"success":true, "suite_id": 59391}]

Delete a Lab Suite

Delete a lab suite


Copy code
$ curl -X DELETE "https://api.testingbot.com/v1/labsuites/:suiteId" \
-u key:secret
Arguments:
  • (int) suiteId - unique Id for this suite
Response:
Copy code
{"success":true}

Get Browsers for Lab Suite

Retrieve what browsers this Lab Suite will run on.


Copy code
$ curl "https://api.testingbot.com/v1/labsuites/:suiteId/browsers" \
-u key:secret
Arguments:
  • (int) suiteId - unique Id for this suite
Response:
Copy code
[{"name":"firefox","version":"41","os":"VISTA"}]

Update Browsers for Lab Suite

Update a Lab Suite, indicate on which browsers the suite should run.
This call will override all existing browsers attached to this suite.


Copy code
$ curl -X POST "https://api.testingbot.com/v1/labsuites/suiteId/browsers" \
-u key:secret -d "browser_ids=515,518
Arguments:
  • (int) suiteId - unique Id for this suite
  • (string, comma-seperated list) browser_ids - list of all browser_ids to add to this suite

You can get the browser_ids by using the List of browsers call and use the browser_ids in that response.

Response:
Copy code
{"success":true}

Get Tests for a Lab Suite

Retrieves all tests in this Suite.


Copy code
$ curl  "https://api.testingbot.com/v1/labsuites/:suiteId/tests" \
-u key:secret

Arguments:
  • (int) suiteId - unique Id for this suite
  • (int) offset (optional) (default 0) - paginate tests starting from this number
  • (int) count (optional) (default 10, max 500) - number of tests to fetch
Response:
Copy code
{
    "data": [
    {
      "id": 18666,
      "enabled": true,
      "alerts": [],
      "url": "https:\/\/mysite.com\/",
      "name": "MyTest",
      "created_at": "2017-03-09T12:14:48.000Z",
      "updated_at": "2017-03-09T12:19:30.000Z",
      "last_run": "2017-03-09T12:19:30.000Z",
      "cron": null,
      "browsers": [
        {
          "name": "firefox",
          "version": "41",
          "os": "VISTA"
        }
      ]
    }
    ],
    "meta": {
        "offset": 0,
        "count": 1,
        "total": 1
    }
}

Add Tests to a Lab Suite

Add one or more tests to this suite.


Copy code
$ curl -X POST "https://api.testingbot.com/v1/labsuites/:suiteId/tests" \
-u key:secret -d "test_ids=3,4"

Arguments:
  • (int) suiteId - unique Id for this suite
  • (string, comma-separated) test_ids - comma-separated list of test_ids to add to this suite.
Response:
Copy code
{"success": true}

Possible errors:
  • 404 Not found - suite not found
  • 400 Bad request - missing test_ids parameter

Remove Tests from a Lab Suite

Remove a test from a Test Suite.


Copy code
$ curl -X DELETE "https://api.testingbot.com/v1/labsuites/:suiteId/tests/:testId" \
-u key:secret

Arguments:
  • (int) suiteId - unique Id for this suite
  • (int) testsId - unique Id for the test in the suite
Response:
Copy code
{"success": true}

Possible errors:
  • 404 Not found - suite not found

TestingBot Storage - Upload File

TestingBot Storage makes it easy to upload a file you want to include during your test(s).
You can use this functionality to test your Android (.apk/.aab) or iOS app (.zip/.ipa), or to download and run before a test starts.


Files uploaded to TestingBot Storage are automatically pruned after 62 days. You can also delete the file manually be using the Delete API call.


Copy code
$ curl -X POST "https://api.testingbot.com/v1/storage" \
-u key:secret -F "file=@/path/to/app/file/Application-debug.apk"
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.upload_local_file(localFilePath)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotStorageUploadResponse uploadResponse = restApi.uploadToStorage(File file);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->uploadLocalFileToStorage($pathToLocalFile);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.storage.upload_local_file(localFilePath)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.uploadFile(localFilePath, function(error, response) {
    // response.app_url
});

Response:
Copy code
{"app_url": "tb://398eijf83i"}

The app_url will be a random string. If you'd like to use your own name, for example because you don't want to keep updating your test scripts each time you add a new app version, then please see below:

Specify your own app name:
Copy code
$ curl -X POST "https://api.testingbot.com/v1/storage/your_name" \
-u key:secret -F "file=@/path/to/app/file/Application-debug.apk"

Response:
Copy code
{"app_url": "tb://your_name"}

Instead of uploading a file from your computer to TestingBot storage, you can also pass an URL where we should download your app:


Copy code
$ curl -X POST "https://api.testingbot.com/v1/storage" \
-u key:secret -d "url=https://...."
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.upload_remote_file(remoteFileUrl)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotStorageUploadResponse uploadResponse = restApi.uploadToStorage(String fileUrl);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->uploadRemoteFileToStorage($urlToRemoteFile);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.storage.upload_remote_file(localFilePath)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.uploadFile(remoteFileUrl, function(error, response) {
    // response.app_url
});

Uploads to our TestingBot Storage are automatically deleted after 62 days.

We've got an example on how to upload a file with Java at our App Automate Java GitHub Repository.

TestingBot Storage - Update File

If you want to update a file you already uploaded, please use this API call.


Use the app_url you received from the original file upload, without the tb:// scheme.

Copy code
$ curl -X POST "https://api.testingbot.com/v1/storage/{app_url}" \
-u key:secret -F "file=@/path/to/app/file/Application-debug.apk"

Response:
Copy code
{"app_url": "tb://398eijf83i"}

In the example above, if your app_url was tb://my-file you would use the URL https://api.testingbot.com/v1/storage/my-file

TestingBot Storage - Uploaded File Data

Retrieve various meta data from a previously uploaded file.


Use the app_url you received from the original file upload.


Copy code
$ curl "https://api.testingbot.com/v1/storage/:app_url" \
-u key:secret
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_uploaded_file(app_url)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingBotStorageFile storedFile = restApi.getStorageFile(String appUrl);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getStorageFile($appUrl);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.storage.get_stored_file(app_url)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getStorageFile(appUrl, function(error, appData) {});

Response:
Copy code
{
    "app_url":"tb://0ec522702cd81ec1374e9b3c",
    "url":"http://...",
    "id":261,
    "type":"ANDROID",
    "filename":"sample.apk",
    "version":"1.0.1",
    "min_device_version": "12.0",
    "thumb":"https://...image.png",
    "created_at":"2019-03-08T08:58:32.000Z"
}

TestingBot Storage - Upload Files List

This API call will return a list of files you or your team members have previously uploaded.


The Response will contain a url parameter which is a signed URL you can use for up to 4 hours.


Copy code
$ curl "https://api.testingbot.com/v1/storage/"
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_uploaded_files(offset = 0, count = 30)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingBotStorageFileCollection fileList = restApi.getStorageFiles(int offset, int count);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getStorageFiles();
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.storage.get_stored_files(offset=0, limit=30)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getStorageFiles(function(error, storedFiles) {}, offset, count);

Response:
Copy code
[{
  "app_url":"tb://....",
  "url":".....",
  "id":44,
  "type":"ANDROID",
  "filename":"sample.apk",
  "version":"1.0.1",
  "min_device_version": "23",
  "thumb":"https://...image.png",
  "created_at":"2019-01-08T13:42:42.000Z"
}]

TestingBot Storage - Delete a file from Storage

Delete a file previously uploaded to TestingBot Storage.


Use the app_url parameter of the file you wish to delete, for example from tb://398eijf83i.


Copy code
$ curl -X DELETE "https://api.testingbot.com/v1/storage/398eijf83i"
Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.delete_uploaded_file(file_identifier)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
boolean success = restApi.deleteStorageFile(String appUrl);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->deleteStorageFile($appUrl);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.storage.remove_file(appUrl)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.deleteStorageFile(fileId, function(error, response) {
    // response.success
});

Response:
Copy code
{"success": true}

IP Ranges for whitelisting

If you would like to whitelist the IPs that are used by the TestingBot machines, you can use the API call below to fetch an up-to-date list.

Copy code
$ curl "https://api.testingbot.com/v1/configuration/ip-ranges"
Response:
Copy code
["109.68.162.161","109.68.162.165","78.20.187.211","185.223.133.13"]

Share Test Result

You can easily share a single test result with someone in a safe way, without the other person needing an account.


To share a test result, you'll need to create the following url:
https://testingbot.com/tests/sessionId?auth=authentication-hash


The sessionId is the ID assigned by the Selenium grid to identify a single test.
You can find this sessionId in your logs when running a test.


The authentication hash is created with md5 in the following format:

Copy code
Digest::MD5.hexdigest("#{client_key}:#{client_secret}#{session_id}")

Copy code
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_authentication_hash(identifier)
Copy code
TestingbotREST restApi = new TestingbotREST(key, secret);
String hash = restApi.getAuthenticationHash(String identifier);
Copy code
$api = new TestingBot\TestingBotAPI($key, $secret);
$api->getAuthenticationHash($identifier);
Copy code
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.get_share_link(identifier)
Copy code
const TestingBot = require('testingbot-api');

const api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});

api.getAuthenticationHashForSharing(identifier);

An example link would then be:
https://testingbot.com/tests/9jf392fj3j2f3ojid8?auth=230i439uf3fojf


Share Test Build

With TestingBot, it is possible to group several tests under one build identifier.
In our member area, you can then see all the tests grouped by builds.


To link directly to a build overview, please see this example:
https://testingbot.com/builds/build-identifier?auth=authentication-hash&key=key


To generate the authentication-hash, you must concatenate key, secret and build_identifier and take the MD5 hash:

Copy code
Digest::MD5.hexdigest("#{client_key}:#{client_secret}#{build-identifier}")

The build-identifier is the custom string you can send as an option to group several tests.