---
title: Setting Name and Status of a TestingBot Test
description: How to change the name and the passed status for a TestingBot Test.
source_url:
  html: https://testingbot.com/support/web-automate/selenium/status
  md: https://testingbot.com/support/web-automate/selenium/status/index.md
---
# Setting Name and Status

Each test that you'll run on TestingBot will show up in the [Members Dashboard](https://testingbot.com/members).   
 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:

- [use our REST API](https://testingbot.com#api)
- [use JavascriptExecutor](https://testingbot.com#javascript_executor)

## TestingBot REST API

You can use our [REST API](https://testingbot.com/support/api#updatetest) 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](https://testingbot.com/support/api#clients).

To use the API, you need the unique identifier of the test that you want to update.   
 Please see [getting the SessionID](https://testingbot.com/support/web-automate/selenium/get-session-id) for more information on how to obtain the sessionID of a specific test.

[Java](https://testingbot.com#)[Python](https://testingbot.com#)[NodeJS](https://testingbot.com#)[Ruby](https://testingbot.com#)[PHP](https://testingbot.com#)[cURL](https://testingbot.com#)

    TestingbotREST restApi = new TestingbotREST("API_KEY", "API_SECRET");
    Map<String, Object> details = new HashMap<>();
    details.put("name", "MyFirstTest");
    details.put("success", true);
    boolean success = restApi.updateTest(webdriverSessionId, details);

    from testingbotclient import TestingBotClient
    
    tb = TestingBotClient('API_KEY', 'API_SECRET')
    tb.tests.update_test(webdriver_session_id, name='MyFirstTest', passed=True, build='build-123')

    const TestingBot = require('testingbot-api');
    
    const api = new TestingBot({
      api_key: 'API_KEY',
      api_secret: 'API_SECRET'
    });
    
    api.updateTest({
      'test[success]': '1',
      'test[name]': 'MyFirstTest'
    }, webdriverSessionId, (error, testDetails) => {
      if (error) console.error(error);
    });

    require 'testingbot'
    
    api = TestingBot::Api.new('API_KEY', 'API_SECRET')
    api.update_test(webdriver_session_id, { name: 'MyFirstTest', success: true })

    $api = new TestingBot\TestingBotAPI('API_KEY', 'API_SECRET');
    $api->updateJob($webdriverSessionId, ['name' => 'MyFirstTest', 'success' => true]);

    curl "https://api.testingbot.com/v1/tests/:webdriver_session_id" \
      -X PUT \
      -d "test[success]=1" \
      -d "test[name]=MyFirstTest" \
      -u API_KEY:API_SECRET

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](https://testingbot.com/support/web-automate/selenium/annotating-tests#start) as well.

[Java](https://testingbot.com#)[Python](https://testingbot.com#)[NodeJS](https://testingbot.com#)[Ruby](https://testingbot.com#)[PHP](https://testingbot.com#)[C#](https://testingbot.com#)

    ((JavascriptExecutor)driver).executeScript("tb:test-name=My test");
    ((JavascriptExecutor)driver).executeScript("tb:test-result=passed");

    driver.execute_script('tb:test-name=My test')
    driver.execute_script('tb:test-result=passed')

    await driver.executeScript('tb:test-name=My test');
    await 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");

Available JavascriptExecutor commands:  

- **tb:test-name=...** - set the name of your test
- **tb:test-result=passed|failed** - set whether the test passed or failed
- **tb:test-build=...** - what build this test belongs to

Was this page helpful? Yes No 

## Looking for More Help?

Have questions or need more information?   
 You can reach us via the following channels:

- [Email us](https://testingbot.com/contact/new)
- [Join our Slack Channel](https://join.slack.com/t/testingb0t/shared_invite/zt-3bcw9xch-jk19~6XPs_xBrsAgAedkCw)
