Start test run API in Test Reporting & Analytics
Use this API to start a test run within a build. Returns a uuid that you must use in the finish test run API call and when associating logs with this test.
Start a test run
Request parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-automation.browserstack.com/ext/v1/builds/BUILD_HASHED_ID/tests/start" \
-H "Content-Type: application/json" \
-d '{
"name": "Verify login functionality",
"file_name": "tests/login_test.py",
"scopes": ["Authentication", "Smoke"],
"started_at": "2025-11-11T10:30:05Z"
}'
-
name* String
Test method or case name. Maximum 500 characters.
-
file_name* String
Name of the test file. Maximum 1000 characters.
-
scopes* Array
Test scopes (for example, [“unit”, “integration”]). Between 1 and 20 scopes, each up to 100 characters.
-
started_at* String (ISO 8601)
Test start timestamp in ISO 8601 format (for example, 2025-11-11T10:31:15Z).
-
tags Array
Test tags for categorization. Maximum 50 tags, each up to 100 characters.
- Show 6 more
-
location String
Test location or file path, including line number (for example, src/test/java/LoginTest.java:42). Maximum 1000 characters.
-
vc_filepath String
Version control file path for the test file. Maximum 1000 characters.
-
result String
Preliminary result of the test. Maximum 50 characters.
-
custom_metadata Object
Custom key-value metadata. Maximum 25 keys, 10 values per key, 500 characters per key or value.
-
environment Object
▶ SHOW VALUESDetails about the environment in which the test runs.
-
device String
Device name used to run the test. Maximum 100 characters.
-
os String
Operating system used to run the test. Maximum 100 characters.
-
os_version String
Operating system version. Maximum 50 characters.
-
browser String
Browser used to run the test. Maximum 100 characters.
-
browser_version String
Browser version. Maximum 50 characters.
-
-
body Object
▶ SHOW VALUESTest source code or body content.
-
lang String
Programming language of the test body (for example, ruby, python, javascript).
-
code String
Source code of the test body.
-
Response attributes 200 OK JSON
Response
{
"success": true,
"uuid": "2d1cacf9-6872-430f-b3ec-38d49102a3f3"
}
-
success Boolean
Indicates if the test was started successfully.
-
uuid String
UUID for the test run. Use this value as the testRunUuid path parameter in the finish test run API call, and as the test_run_uuid field when adding logs for this test.
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.