Skip to main content
Table of Contents

Get tests API in Test Observability

Use this API to get the list of test executions along with the result for a specific build run. You can get a subset of the test runs you want by passing the relevant request parameters.

get tests

GET https://api-observability.browserstack.com/ext/v1/builds/{build_id}/testRuns

Request parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://api-observability.browserstack.com/ext/v1/builds/81yobvicuiuozd1bncaeegvubey7rbl8naevwets/testRuns
  • re_runs String

    Get tests belonging to specific runs

  • ci_build_numbers String

    Get the test runs associated with specific CI build numbers

  • test_statuses String

    Filter the test runs by their status

  • host_names String

    Filter the test runs by host names

  • is_flaky Boolean

    Set to ‘true’, to filter test runs that are flaky

  • has_performance_anomaly Boolean

    Set to ‘true’, to focus on test runs that have performance anomalies

  • is_new_failure Boolean

    Set to to true, to focus on tests that have newly failed in this run.

  • is_always_failing Boolean

    Set to to true, to focus the tests tagged as always failing.

  • is_muted Boolean

    Set to to true, to filter for muted tests.

  • failure_categories String

    Filters test failures by failure categories.

  • devices String

    Focus on tests run on a specific devices.

  • os String

    Filter test runs by the operating systems they run on.

  • sort String

    Used to specify the criterion by which the tests have to be sorted. Available critetia are EXECUTION_ORDER, TOP_LEVEL_NAME, DURATION, FAILED_TEST, and PLATFORM

  • order String

    Used to sort tests in ascending or descending order. (Asc for ascending and Desc for descending).

  • next_page String

    Used to fetch subsequent pages of the build list. Pass the next_page reference received in the response of last request.

Response Attributes 200 OK JSON

Response

{
    "name": "Test Observability Samples",
    "project_id": 825,
    "group_id": 2,
    "build_id": "81yobvicuiuozd1bncaeegvubey7rbl8naevwets",
    "build_name": "wdio-cucumber-samples",
    "build_number": 235,
    "original_name": "wdio-cucumber-samples",
    "test_summary": {
        "passed": 30,
        "failed": 24,
        "pending": 0,
        "skipped": 8,
        "unknown": 0
    },
    "is_archived": false,
    "hierarchy": [
        {
            "summary": {
                "passed": 1,
                "failed": 3,
                "pending": 0,
                "skipped": 0,
                "unknown": 0
            },
            "is_after_all_hook": null,
            "children": [
                {
                    "summary": null,
                    "is_after_all_hook": null,
                    "children": [],
                    "rank": 2,
                    "details": {
                        "is_flaky": false,
                        "is_always_failing": false,
                        "is_auto_analyzed": null,
                        "observability_url": "https://observability.browserstack.com/projects/Test+Observability+Samples/builds/wdio-cucumber-samples/235?tab=tests&details=10889191",
                        "is_performance_anomaly": false,
                        "is_muted": false,
                        "is_new_failure": false,
                        "tags": [
                            "@browser"
                        ],
                        "run_count": 1,
                        "duration": 10258,
                        "retries": [
                            {
                                "uuid": "1618677e-6154-4e7a-b155-cb359d455c99",
                                "status": "failed",
                                "duration": 10258,
                                "logs": {
                                    "TEST_FAILURE": [
                                        "Error: function timed out, ensure the promise resolves within 10000 milliseconds\n    at Timeout.<anonymous> (C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\staging-sanity\\wdio-cucumber\\test-samples\\nodejs\\wdio\\node_modules\\@cucumber\\cucumber\\src\\time.ts:52:14)\n    at listOnTimeout (node:internal/timers:557:17)\n    at processTimers (node:internal/timers:500:7)"
                                    ],
                                    "TEST_LOG": [
                                        "https://browserstack-obs-testlogs-preprod-euc1.s3.eu-central-1.amazonaws.com/metadata/81yobvicuiuozd1bncaeegvubey7rbl8naevwets/1618677e-6154-4e7a-b155-cb359d455c99-screenshots.jsonl.gz?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEJX%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDGV1LWNlbnRyYWwtMSJGMEQCIEHJ711HGTc%2FtfScyEv9Mi2uzkrv4GEkQk7OHTqzHZIMAiAYKcp3FutG4d%2B386HVt6%2FcHXuYGgeL%2F0QqAXP3osoLhSqpBQju%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8BEAAaDDczNzk2MzEyMzczNiIMVdA7JaCBS5qod%2BrRKv0EWuf04vWUwgXwuHUpGo%2Ft%2F8G0uOfyIopjTGyVqR4NypNDn%2FBzGRndgcJCmzj4uoX7pPt7Lniy0SgX4%2BV%2B1oZ9FmRYFxSk02c5Qb77zyyAwMHLMJ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-Amz-SignedHeaders=host&X-Amz-Expires=7200&X-Amz-Credential=ASIA2XUQHUQMFKU3UUW4%2F20240508%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Signature=0660624cc14eb3570ee8e51be98f17b607e6a8c83bcf90f5262b0fc56d06d76b"
                                    ]
                                }
                            }
                        ],
                        "jira_details": [],
                        "is_auto_analyzer_running": false,
                        "is_latest": true,
                        "status": "failed"
                    },
                    "type": "TEST",
                    "display_name": "Verify Logging - Browserstack Logo Text - Fail",
                    "is_before_all_hook": null
                },
                {
                    "summary": null,
                    "is_after_all_hook": null,
                    "children": [],
                    "rank": 2,
                    "details": {
                        "is_flaky": false,
                        "is_always_failing": true,
                        "is_auto_analyzed": null,
                        "observability_url": "https://observability.browserstack.com/projects/Test+Observability+Samples/builds/wdio-cucumber-samples/235?tab=tests&details=10889221",
                        "is_performance_anomaly": false,
                        "is_muted": false,
                        "is_new_failure": false,
                        "tags": [
                            "@browser"
                        ],
                        "run_count": 1,
                        "duration": 191122,
                        "retries": [
                            {
                                "uuid": "c17bccdc-4a15-44ab-97f0-3c9596b4e2a6",
                                "status": "failed",
                                "duration": 191122,
                                "logs": {
                                    "TEST_FAILURE": [
                                        "Error: Can't call setValue on element with selector \"#username input\" because element wasn't found\n    at implicitWait (file:///C:/ProgramData/Jenkins/.jenkins/workspace/staging-sanity/wdio-cucumber/test-samples/nodejs/wdio/node_modules/webdriverio/build/utils/implicitWait.js:29:19)\n    at Element.elementErrorHandlerCallbackFn (file:///C:/ProgramData/Jenkins/.jenkins/workspace/staging-sanity/wdio-cucumber/test-samples/nodejs/wdio/node_modules/webdriverio/build/middlewares.js:15:29)\n    at Element.wrapCommandFn (file:///C:/ProgramData/Jenkins/.jenkins/workspace/staging-sanity/wdio-cucumber/test-samples/nodejs/wdio/node_modules/@wdio/utils/build/shim.js:90:29)\n    at SignInAppErrorPage.login (C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\staging-sanity\\wdio-cucumber\\test-samples\\nodejs\\wdio\\pageobjects\\bstack-demo\/signIn.app.error.page.js:29:9)"
                                    ],
                                    "TEST_LOG": [
                                        "https://browserstack-obs-testlogs-preprod-euc1.s3.eu-central-1.amazonaws.com/metadata/81yobvicuiuozd1bncaeegvubey7rbl8naevwets/c17bccdc-4a15-44ab-97f0-3c9596b4e2a6-screenshots.jsonl.gz?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEJX%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDGV1LWNlbnRyYWwtMSJGMEQCIEHJ711HGTc%2FtfScyEv9Mi2uzkrv4GEkQk7OHTqzHZIMAiAYKcp3FutG4d%2B386HVt6%2FcHXuYGgeL%2F0QqAXP3osoLhSqpBQju%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8BEAAaDDczNzk2MzEyMzczNiIMVdA7JaCBS5qod%2BrRKv0EWuf04vWUwgXwuHUpGo%2Ft%2F8G0uOfyIopjTGyVqR4NypNDn%2FBzGRndgcJCmzj4uoX7pPt7Lniy0SgX4%2BV%2B1oZ9FmRYFxSk02c5Qb77zyyAwMHLMJdgMdmi38yn1TI03QqdmTFuY94T4x8neQmzAkwoSpDftH%2BFSmFEx8ghgtaYtoeOH2xaDTUL0EvPu8GQfCfDqpJscgfyKv1Ye5K%2BYlR9roBGDIWZjIOtVaWR7X6lthVlCozh2QE%2FMWTwLRSCOuPE1ApmT8UkSQt4ZEZnrypsgAjA5lyp%2B3APj2yIJRcfmHvDnnKeAeH1w%2FgTX0N773OHsi620EpB3%2BIdr6gHn%2F6doRo118J8KDtpHvxQRR0LLhTvFDgpTKU%2Fh60zJY6SPrCGtKOwkVH3qDa3GbgdLCdk4Wsl3PD6zrJ3WVhbpnp%2BFvddpfYabzF2pNhrpr%2BznNPE%2B%2FLizjX8bGvb1SXCaqTSsnAU3XsCRwB4Z6HP5eNWtYVTKMQjyroSblAfFeGEiLxBk3ZH88G75x%2FS1sJcNGjHluSK%2FaTeTAubd%2FZ9lSed6I50yAaLpUCMdQAwEZIB36utqmzJm7auM2d3drViaL0wutkZf8QJxKjot1sBa8QV1584mMEUQ5Zp2VBakZHdJDwSPcGDPQBjbv9HlgvqTOdE%2FeidWW1KvWdg92RFhYu5Jp%2BH9Fr%2B%2ByE95KOZFm7f1PvJTxfh29c%2FhqU3TeDBq5QNwgNoUgzpgKfBlPTnLrMjoJ23q5JvcGgJ37L24XFx2CaPNxP3WUnePdUh47u6ywVhPG6aJoTfUDNnPfp%2Baxbb9mLfME3eJ5EP2SfhUCTScfB7bEL07Qs7JmdOsPURZTCk6e2xBjqcAY1BI5hpWykZec6ViD%2B%2FU7gheZFse117EqY%2BjZjzYZWeVmfiklp7%2FhcRMD%2BgzGyNssDReZrb9Pujw4QPlb%2FvCfMVbzwze%2Beg2qVqQuE%2BE6UKuvLecJqsihArO6Fodw6XyrKu6Lv9DDlP6qz2E5%2FLudQGab1i%2FCrGKJpRS9uGLWcA1u6kcw6ktpRyaleoxvMCOu3cEKMnOGuv5%2FAQBw%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240508T130047Z&X-Amz-SignedHeaders=host&X-Amz-Expires=7200&X-Amz-Credential=ASIA2XUQHUQMFKU3UUW4%2F20240508%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Signature=e7974f2c13666159495bcf785b0d28638733fad10fdbf0c7a9f0011bd83575b4"
                                    ]
                                }
                            }
                        ],
                        "jira_details": [],
                        "is_auto_analyzer_running": false,
                        "is_latest": true,
                        "status": "failed"
                    },
                    "type": "TEST",
                    "display_name": "Verify Logging - Browserstack Logo Text (1)",
                    "is_before_all_hook": null
                },
                {
                    "summary": null,
                    "is_after_all_hook": null,
                    "children": [],
                    "rank": 2,
                    "details": {
                        "is_flaky": false,
                        "is_always_failing": false,
                        "is_auto_analyzed": null,
                        "observability_url": "https://observability.browserstack.com/projects/Test+Observability+Samples/builds/wdio-cucumber-samples/235?tab=tests&details=10889360",
                        "is_performance_anomaly": false,
                        "is_muted": false,
                        "is_new_failure": false,
                        "tags": [],
                        "run_count": 1,
                        "duration": 17,
                        "retries": [
                            {
                                "uuid": "2ebbae12-1706-4927-9726-278907c30915",
                                "status": "passed",
                                "duration": 17,
                                "logs": {}
                            }
                        ],
                        "jira_details": [],
                        "is_auto_analyzer_running": false,
                        "is_latest": true,
                        "status": "passed"
                    },
                    "type": "TEST",
                    "display_name": "Verify API Loging Count (1)",
                    "is_before_all_hook": null
                },
                {
                    "summary": {
                        "passed": 0,
                        "failed": 0,
                        "pending": 0,
                        "skipped": 0,
                        "unknown": 0
                    },
                    "is_after_all_hook": true,
                    "children": [],
                    "rank": 2,
                    "details": {
                        "is_flaky": false,
                        "is_always_failing": false,
                        "is_auto_analyzed": null,
                        "observability_url": "https://observability.browserstack.com/projects/Test+Observability+Samples/builds/wdio-cucumber-samples/235?tab=tests&details=10889361",
                        "is_performance_anomaly": false,
                        "is_muted": false,
                        "is_new_failure": false,
                        "tags": [],
                        "run_count": 1,
                        "duration": 7,
                        "retries": [
                            {
                                "uuid": "a6a879e4-037c-4f89-90a9-bd2b9a86f57a",
                                "status": "failed",
                                "duration": 7,
                                "logs": {
                                    "TEST_FAILURE": [
                                        "AssertionError: assert.fail()\n    at C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\staging-sanity\\wdio-cucumber\\test-samples\\nodejs\\wdio\\hooks\\support\/hooks.js:22:14\n    at wrapPromiseWithTimeout (C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\staging-sanity\\wdio-cucumber\\test-samples\\nodejs\\wdio\\node_modules\\@cucumber\\cucumber\\src\\time.ts:55:10)\n    at Object.run (C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\staging-sanity\\wdio-cucumber\\test-samples\\nodejs\\wdio\\node_modules\\@cucumber\\cucumber\\src\\user_code_runner.ts:86:16)\n    at Runtime.runTestRunHooks (C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\staging-sanity\\wdio-cucumber\\test-samples\\nodejs\\wdio\\node_modules\\@cucumber\\cucumber\\src\\runtime\\run_test_run_hooks.ts:21:29)\n    at Runtime.start (C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\staging-sanity\\wdio-cucumber\\test-samples\\nodejs\\wdio\\node_modules\\@cucumber\\cucumber\\src\\runtime\\index.ts:118:5)\n    at runCucumber (C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\staging-sanity\\wdio-cucumber\\test-samples\\nodejs\\wdio\\node_modules\\@cucumber\\cucumber\\src\\api\\run_cucumber.ts:125:19)"
                                    ]
                                }
                            }
                        ],
                        "jira_details": [],
                        "is_auto_analyzer_running": false,
                        "is_latest": true,
                        "status": "failed"
                    },
                    "type": "HOOK",
                    "display_name": "AFTER_ALL for BStack Logging Components",
                    "is_before_all_hook": false
                }
            ],
            "rank": 0,
            "details": {
                "file_path": "features/e2e/bstack_demo/Logging.feature",
                "os": {
                    "name": "os x",
                    "version": "big sur",
                    "key": "OS X,Big Sur"
                },
                "finished_at": null,
                "browser": {
                    "name": "chrome",
                    "version": "124",
                    "key": "Chrome,124"
                },
                "vc_file_url": "https://github.com/browserstack/test-observability-samples/blob/695155b136e6a6d6db50a4318ff4a39da843f418/test-samples/nodejs/wdio/features/e2e/bstack_demo/Logging.feature",
                "device": "",
                "middle_scopes": null
            },
            "type": "ROOT",
            "display_name": "BStack Logging Components",
            "is_before_all_hook": null
        },
                ],
    "pagination": {
        "has_next": true,
        "next_page": "eyJvcyI6Ik9TIFgsQmlnIFN1ciIsImRldmljZSI6Ik5BIiwiZmlsZU5hbWUiOiJmZWF0dXJlcy9lMmUvYnN0YWNrX2RlbW8vaG9tZS9Ib21lUGFnZS5mZWF0dXJlIiwiYnJvd3NlciI6IkNocm9tZSwxMjQifQ=="
    },
}
  • name String

    Name of the project

  • project_id String

    ID of the project.

  • group_id Integer

    Identifier for your account or group.

  • build_id String

    Unique id of the build run. Also referred to as build uuid in some places.

  • build_name String

    The name of the build. This is the derived build name of the after removing the dynamic parts from the name passed by you.

  • build_number Integer

    Serial number of the run for a given build, generated by Test Observability.

  • original_name String

    Exact name of the build as passed at the time of ingestion by client. This includes the dynamic parts like build serial numbers as well.

  • test_summary Object

    A list of all the test statuses along with the number of tests in those statuses

  • is_Archived Boolean

    Specifies if the build run is archived or not.

  • hierarchy Object

    Contains a list of all the tests with the test details and the test statuses.

  • pagination JSON Object

    Specifies if there is a next page and provides the value for next page.

    SHOW VALUES
    • has_next Boolean

      True if there is a next page. False if there is no next page.

    • next_page String

      A reference to the next page. Pass this as a request parameter in the subsequent request as “next_page” to get the next page of records.

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