Features

Setting Name and Status

Each test that you'll run on TestingBot will show up in the Members Dashboard.
By default, we do not know what the name of this test is and if it passed or not.

To correctly display the test name and status, there are two options:

TestingBot REST API

You can use our REST API to update the status and meta-data of a test.
The API can be used with any HTTP client, or use one of our API client libraries.

To use the API, you need the unique identifier of the test that you want to update.
Please see getting the SessionID for more information on how to obtain the sessionID of a specific test.

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

var api = new TestingBot({
  api_key: "your-tb-key",
  api_secret: "your-tb-secret"
});
var testData = { "test[success]" : "1", "test[name]" : "MyFirstTest" };
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

JavascriptExecutor

TestingBot has its own, custom JavascriptExecutor methods that you can call during your test, to change the meta-data of the test that is running.

Besides changing the name and status of a test, we offer other JavascriptExecutor methods as well.

driver.execute_script('tb:test-name=My test')
driver.execute_script('tb:test-result=passed')
((JavascriptExecutor)driver).executeScript("tb:test-name=My test");
((JavascriptExecutor)driver).executeScript("tb:test-result=passed");
$web_driver->executeScript('tb:test-name=My test');
$web_driver->executeScript('tb:test-result=passed');
driver.execute_script('tb:test-name=My test')
driver.execute_script('tb:test-result=passed')
driver.executeScript('tb:test-name=My test')
driver.executeScript('tb:test-result=passed')
((IJavaScriptExecutor)driver).ExecuteScript("tb:test-name=My test");
((IJavaScriptExecutor)driver).ExecuteScript("tb:test-result=passed");
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