Skip to main content
No Result Found

Test results

Test results within test runs are important for analyzing and understanding the outcomes of your testing efforts. Our REST API offers comprehensive endpoints for managing test results in test runs, enabling you to automate the collection and evaluation of testing data. With these endpoints, you can add one or more test results in your test runs within your project.

Get all test results for a test run

GET /api/v2/projects/{project_id}/test-runs/{test_run_id}/results

Use this API to fetch the list of all test results for a test run in a project. You will need the id of the project and the id of the test run.

This list is paginated; for more information, refer Pagination.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://test-management.browserstack.com/api/v2/projects/{project_id}/test-runs/{test_run_id}/results
  • project_id* String

    Identifier of the project.

  • test_run_id* String

    Identifier of the test run.

Response Attributes 200 OK json

Response

{
    "success": true,
    "test-results": [
        {
            "id": 425536077, 
            "created_by" : "abc@gmail.com"
            "created_at": "2024-08-19T07:38:55.000Z",
            "description": "This is the notes added with result",
            "test_run_id": "TR-321",
            "test_case_id": "TC-123",
            "result_status": {
                "field_value": "Passed",
            },
            "updated_at": "2024-08-19T07:38:55.000Z",
            "issues": [
                {
                    "issue_id": "UI-393854",
                    "created_at": "2024-08-19T07:35:42.000Z",
                    "issue_type": "jira",
                },
                ...
            ],
             "custom_fields": [
                {
                    "field_name": "custom estimates",
                    "value": "10.23",
                }
                ...
            ]
        },
         ...
    ],
    "info": {
        "page": 1,
        "page_size": 30,
        "count": 20,
        "prev": null,
        "next": null
    }
  }
  • success Boolean

    Indicates whether the API call was executed successfully.

  • test-results Array

    List of test results associated with the test run or test case.

    SHOW VALUES
    • id Integer

      Unique identifier of the test result.

    • created_by String

      Email of the user who created the test result.

    • created_at String

      Timestamp when the test result was created.

    • description String

      Notes or additional information added to the test result.

    • test_run_id String

      Identifier of the test run to which the test result belongs.

    • test_case_id String

      Identifier of the test case to which the test result belongs.

    • result_status Object

      Contains the status of the test result.

    • result_status.field_value String

      The result status value, e.g., “Passed” or “Failed.”

    • updated_at String

      Timestamp when the test result was last updated.

  • issues Array

    List of issues linked to the test result.

    SHOW VALUES
    • issue_id String

      Identifier of the linked issue.

    • created_at String

      Timestamp when the issue was created.

    • issue_type String

      Type of the issue, e.g., “Jira.”

  • custom_fields Array

    List of custom fields associated with the test result.

    SHOW VALUES
    • field_name String

      Name of the custom field.

    • value String

      Value of the custom field.

Get all test results for a test case in a test run

GET /api/v2/projects/{project_id}/test-runs/{test_run_id}/test-cases/{test_case_id}/results

Use this API to fetch all test results for a test case in a test run in a project. You will need the id of the project, the id of the run and the id of the test case.

This list is paginated; for more information, refer Pagination.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://test-management.browserstack.com/api/v2/projects/{project_id}/test-runs/{test_run_id}/test-case/{test_case_id}/results
  • project_id* String

    Identifier of the project.

  • test_run_id* String

    Identifier of the test run.

  • test_case_id* String

    Identifier of the test case.

Response Attributes 200 OK json

Response

{
    "success": true,
    "test-results": [
        {
            "id": 425536077, 
            "created_by" : "abc@gmail.com"
            "created_at": "2024-08-19T07:38:55.000Z",
            "description": "This is the notes added with result",
            "test_run_id": "TR-321",
            "test_case_id": "TC-123",
            "result_status": {
                "field_value": "Passed",
            },
            "updated_at": "2024-08-19T07:38:55.000Z",
            "issues": [
                {
                    "issue_id": "UI-393854",
                    "created_at": "2024-08-19T07:35:42.000Z",
                    "issue_type": "jira",
                },
                ...
            ],
             "custom_fields": [
                {
                    "field_name": "custom estimates",
                    "value": "10.23",
                }
                ...
            ]
        },
         ...
    "info": {
        "page": 1,
        "page_size": 30,
        "count": 20,
        "prev": null,
        "next": null
    }
  }
  • success Boolean

    Indicates whether the API call was executed successfully.

  • test-results Array

    List of test results associated with the test run or test case.

    SHOW VALUES
    • id Integer

      Unique identifier of the test result.

    • created_by String

      Email of the user who created the test result.

    • created_at String

      Timestamp when the test result was created.

    • description String

      Notes or additional information added to the test result.

    • test_run_id String

      Identifier of the test run to which the test result belongs.

    • test_case_id String

      Identifier of the test case to which the test result belongs.

    • result_status Object

      Contains the status of the test result.

    • result_status.field_value String

      The result status value, e.g., “Passed” or “Failed.”

    • updated_at String

      Timestamp when the test result was last updated.

  • issues Array

    List of issues linked to the test result.

    SHOW VALUES
    • issue_id String

      Identifier of the linked issue.

    • created_at String

      Timestamp when the issue was created.

    • issue_type String

      Type of the issue, e.g., “Jira.”

  • custom_fields Array

    List of custom fields associated with the test result.

    SHOW VALUES
    • field_name String

      Name of the custom field.

    • value String

      Value of the custom field.

Get all test results for a test case across test runs

GET /api/v2/projects/{project_id}/test-cases/{test_case_id}/results

Use this API to fetch the list of all test results for a test case across test runs in a project. You will need the id of the project and the id of the test case.

This list is paginated; for more information, refer Pagination.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://test-management.browserstack.com/api/v2/projects/{project_id}/test-case/{test_case_id}/results
  • project_id* String

    Identifier of the project.

  • test_case_id* String

    Identifier of the test case.

Response Attributes 200 OK json

Response

{
    "success": true,
    "test-results": [
        {
            "id": 425536077, 
            "created_by" : "abc@gmail.com"
            "created_at": "2024-08-19T07:38:55.000Z",
            "description": "This is the notes added with result",
            "test_run_id": "TR-321",
            "test_case_id": "TC-123",
            "result_status": {
                "field_value": "Passed",
            },
            "updated_at": "2024-08-19T07:38:55.000Z",
            "issues": [
                {
                    "issue_id": "UI-393854",
                    "created_at": "2024-08-19T07:35:42.000Z",
                    "issue_type": "jira",
                },
                ...
             "custom_fields": [
                {
                    "field_name": "custom estimates",
                    "value": "10.23",
                }
                ...
            ]
        },
         ...
    ],
    "info": {
        "page": 1,
        "page_size": 30,
        "count": 20,
        "prev": null,
        "next": null
    }
  }
  • success Boolean

    Indicates whether the API call was executed successfully.

  • test-results Array

    List of test results associated with the test run or test case.

    SHOW VALUES
    • id Integer

      Unique identifier of the test result.

    • created_by String

      Email of the user who created the test result.

    • created_at String

      Timestamp when the test result was created.

    • description String

      Notes or additional information added to the test result.

    • test_run_id String

      Identifier of the test run to which the test result belongs.

    • test_case_id String

      Identifier of the test case to which the test result belongs.

    • result_status Object

      Contains the status of the test result.

    • result_status.field_value String

      The result status value, e.g., “Passed” or “Failed.”

    • updated_at String

      Timestamp when the test result was last updated.

  • issues Array

    List of issues linked to the test result.

    SHOW VALUES
    • issue_id String

      Identifier of the linked issue.

    • created_at String

      Timestamp when the issue was created.

    • issue_type String

      Type of the issue, e.g., “Jira.”

  • custom_fields Array

    List of custom fields associated with the test result.

    SHOW VALUES
    • field_name String

      Name of the custom field.

    • value String

      Value of the custom field.

Add test result to test run

POST /api/v2/projects/{project_id}/test-runs/{test_run_id}/results

Use this API to add test results to test runs in a given project. To add a test result to a specific test run, you will need both the id of the project and the id of the test run within that project.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/{project_id}/test-runs/{test_run_id}/results
  • project_id* String

    Identifier of the project.

  • test_run_id* String

    Identifier of the test run.

Request Body

Request Body

{
  "test_result": {
    "status": "passed",
    "description": "Login functionality under high user load",
    "issues": [
      "TR-2",
      "XYZ-2"
    ],
    "custom_fields": {
      "custom_fields_name": "value"
    }
  },
  "test_case_id": "TC-13",
  "configuration_id": 116
}
  • status* String

    The status field is mandatory. Use either a system value (e.g., ”Passed,” “Failed,” etc.) or a custom value defined in Test Management. Attempting to define new status values via this API will result in an error response.

  • description String

    Brief information about the test run.

  • issues Array

    List of the linked Jira issues.

  • custom_fields Object

    List of the custom fields and their corresponding values.

  • test_case_id* String

    Identifier of each test case.

  • configurations_id Integer

    Unique identifier for a specific operating system, browser, and device configuration. This optional parameter is required only if a test run includes configurations.

Response Attributes 200 OK json

Response


{
  "success": true,
  "test-result": {
    "id": 66782871,
    "created_at": "2023-11-29T06:30:36.000Z",
    "description": "Test passed successfully, but with some issues noted",
    "status": "passed",
    "issues": [
      "TR-2",
      "XYZ-2"
    ]
  }
}
  • success Boolean

    API call is executed successfully.

  • id Integer

    Identifier for the test result.

  • created_at String

    Tht time at which the test result was created on BrowserStack servers.

  • status String

    Gives the status of the test result.

  • description String

    Brief information about the Test Run.

  • issues Array

    List of the linked Jira issues.

Add multiple test results in a test run

POST /api/v2/projects/{project_id}/test-runs/{test_run_id}/results

Use this API to add multiple test results in a test run in a given project. To do so, you will need the id of the project, the id of the test run within that project, status of the test result and the id of the test case.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/{project_id}/test-runs/{test_run_id}/results
  • project_id* String

    Identifier of the project.

  • test_run_id* String

    Identifier of the test run.

Request Body

Request Body

{
  "results": [
    {
      "test_result": {
        "status": "passed",
        "description": "Login functionality under high user load",
        "issues": [
          "TR-2",
          "XYZ-2"
        ],
        "custom_fields": {
          "custom_fields_name": "value"
        }
      },
      "test_case_id": "TC-337204",
      "configuration_id": 116
    },
    {
      "test_result": {
        "status": "skipped",
        "description": "Sensitive data is masked or encrypted",
        "issues": [
          "TR-23",
          "XYZ-27"
        ],
        "custom_fields": {
          "custom_fields_name": "value"
        }
      },
      "test_case_id": "TC-337205",
      "configuration_id": 126
    },
    ...
  ]
}
  • test_result Object

    This list has information about test results.

    SHOW VALUES
    • status* String

      The status field is mandatory. Use either a system value (e.g., ”Passed,” “Failed,” etc.) or a custom value defined in Test Management. Attempting to define new status values via this API will not record those statuses.

    • description String

      Brief information/notes about the test result.

    • issues Array

      List of the linked Jira issues.

    • custom_fields Object

      List of the custom fields and their corresponding values.

  • test_case_id* String

    Identifier of each test case.

  • configuration_id Integer

    Unique identifier for a specific operating system, browser, and device configuration. This optional parameter is required only if a test run includes configurations.

Response Attributes 200 OK json

Response


{
    "success": true
}
  • success Boolean

    API call is executed successfully.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Download Copy Check Circle