Skip to main content
🎉 A11y Issue Detection Agent is now live! Detect accessibility issues like a WCAG expert with AI. Try now!
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Get test case report issues API in Automated tests

Use this API to get the accessibility issues found in a test case of an Automated tests build. The API returns a link to a CSV report with one issue per row. Each row lists the WCAG success criteria that the issue violates.

How this API works

This API generates the report in the background. You call this endpoint once to start generating the report, and again to get the report link. To get the report for a test case, follow these steps:

  1. Get the build ID, thBuildId, from the response of the Get build list API.
  2. Get the test case ID from the id field in the response of the Get test case list API.
  3. Call this endpoint with the test_case parameter to start generating the report. The response includes the task ID in the data.task_id field.
  4. Call this endpoint again with the task_id parameter. If the report is ready, the response includes report_link. If not, wait a few seconds and call the endpoint again with the same task_id.
  5. Download the CSV file from report_link. The Guideline(s) column lists the WCAG success criteria for each issue, for example, SC 1.4.3.

Pass the complete task_id string, for example, ext_api_issues:TestCase:afd17c69-2b80-4a3f-abb1-f427f8d71093:1793972975. The number at the end of the string is a timestamp, not the task ID.

A task_id expires two hours after it is created. After that, call this endpoint with the test_case parameter again to get a new task_id. The report_link is a signed URL that expires after 12 hours, so download the CSV file before then.

You can also get the issues from an Automated tests build in an AI assistant, such as Claude or Cursor. When you ask in natural language, the fetchAccessibilityIssues tool of the BrowserStack MCP server fetches the issues. For supported workflows, see Reports and issues tools in the BrowserStack MCP server.

get test case report issues

GET https://api-accessibility.browserstack.com/api/automated-tests/v1/builds/{thBuildId}/issues?test_case={test_case_id}

GET https://api-accessibility.browserstack.com/api/automated-tests/v1/builds/{thBuildId}/issues?task_id={task_id}

If Geo Region Restriction (GRR) is enabled for your account, add your region code to the host name: api-accessibility-<region>.browserstack.com. See Geo Region Restriction endpoints for the region codes and examples.

Request parameters

Request to start generating the report

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
"https://api-accessibility.browserstack.com/api/automated-tests/v1/builds/{thBuildId}/issues?test_case={test_case_id}"

Response with the task ID

{
    "success": true,
    "data": {
        "task_id": "ext_api_issues:TestCase:afd17c69-2b80-4a3f-abb1-f427f8d71093:1793972975",
        "message": "CSV file link generation has been initiated."
    },
    "error": null
}

Request to get the report link

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
"https://api-accessibility.browserstack.com/api/automated-tests/v1/builds/{thBuildId}/issues?task_id={task_id}"
  • test_case String

    ID of the test case. Use the id value from the Get test case list API response. Required in the first call, which starts generating the report. The response includes the task ID in the data.task_id field.

  • task_id String

    Complete task ID returned by the first call, for example, ext_api_issues:TestCase:<uuid>:<timestamp>. Required in later calls, which get the report link. A task ID expires two hours after it is created.

  • next_page String

    Used to fetch subsequent pages from the API when has_next parameter is true. Pass the next_page reference received in the response of last request.

Response Attributes 200 OK JSON

When you call this endpoint with a task_id and the report is ready, the API returns the following response.

Response with the report link

{
    "name": "BStack Sample Test - Add product to cart",
    "tags": null,
    "file": "/src/test/resources/features/sample.feature",
    "scopeList": [
        "browserstack-demo"
    ],
    "osData": {
        "name": "OS X",
        "version": null,
        "logo": "mac"
    },
    "browserData": {
        "name": "chrome",
        "version": "131.0.6778.70",
        "logo": "chrome"
    },
    "report_link": "<CSV_file_link>"
}
  • name String

    Name of the test case.

  • tags String

    Any tag associated with the test case.

  • file String

    The path of the filename that houses the test case.

  • scopeList Array

    An array of strings that describes the scope of the test case.

  • osData Object

    Contains details about the OS on which the test case was run.

    ▶ SHOW VALUES
    • name String

      Name of the OS used.

    • version String

      Version of the OS used.

    • logo Object

      Brand name of the OS used.

  • browserData Object

    Contains details about the browser on which the test case was run.

    ▶ SHOW VALUES
    • name String

      Name of the browser used.

    • version String

      Version of the browser used.

    • logo String

      Brand name of the browser used.

  • report_link String

    Signed link to the CSV report, returned when the report is ready. Each row is one issue, and the Guideline(s) column lists its WCAG success criteria. The link expires after 12 hours.

  • pagination Object

    Contains information to facilitate fetching additional records if they exist.

    ▶ SHOW VALUES
    • has_next Boolean

      True if there are more records to fetch. False if the current response is the last page of records.

    • 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

Download Copy Check Circle