Test Cases
Test Cases are essential in verifying specific features or functionality in the software testing process. Our REST API provides comprehensive endpoints for handling test cases. With this endpoint, you can access the list of test cases in a project based on specific attributes.
Note: For a comprehensive list of default Enum values (such as Priority, State, and Type of Test Case), refer to the System-defined Enum values page.
Get the list of test cases
Invoking this API will fetch the list of test cases in a project. You will need the id
of the project to access its list of test cases.
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/PR-1/test-cases
-
project_id* String
Identifier of the project.
Response Attributes 200 OK
json
Response
{
"success": true,
"test_cases": [
{
"case_type": "Accessibility",
"priority": "Low",
"status": "Active",
"folder_id": 19590,
"issues": ["TASK-309"],
"tags": [
"link",
"Regression"
],
"template": "test_case_steps",
"description": "<p test case description of verify location access.</p> <p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample description</span><img data-id=\"xyz123\"></p>",
"preconditions": "<p>a valid pre-condition text.</p>",
"title": "verify location access",
"identifier": "TC-16667",
"automation_status": "not_automated",
"owner": "john.doe@email.com",
"attachments": [
{
"size": "200 KB",
"name": "3.jpg",
"content_type": "image/jpeg",
"url": "https://teststack-stage.s3.amazonaws.com/media/genric/3/10334/8857111d-8b50-4e45-926b-c50fffd7a8d5?AWSAccessKeyId=AKIAWGP4IFPZPKMOIAG6&Expires=1707390465&Signature=f%2Bb8dbboIG20M51ZqT3Lx81Bk64%3D"
}
],
"steps": [
{
"step": "Launch the App",
"result": "Open the Android app on the device or emulator."
},
{
"step": "<p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample step</span><img data-id=\"xyz123\"></p>",
"result": "test"
},
{
"step": "Identify Location Feature",
"result": "Locate the feature or functionality within the app that requires location access (e.g., map view, search by location)."
},
{
"step": "Trigger Location Permission Request",
"result": "Verify the system permission request dialog appears for location access."
},
{
"step": "Select Permission Option",
"result": "Choose the desired permission option (e.g., Allow All the Time, Allow While Using the App, Deny)."
}
],
"custom_fields": [
{
"name": "estimate",
"value": "t1"
},
{
"name": "Automation Type",
"value": "Automation not required "
},
{
"name": "String-check",
"value": "test the login"
},
]
},
{
"case_type": "Accessibility",
"priority": "Low",
"status": "Active",
"folder_id": 19590,
"issues": [],
"tags": [
"a"
],
"template": "test_case_text",
"description": "",
"preconditions": "a valid pre-condition text.",
"title": "Verify Login Functionality",
"identifier": "TC-1046",
"automation_status": "not_automated",
"owner": null,
"attachments": [],
"steps": [],
"custom_fields": []
}
],
"info": {
"page": 1,
"page_size": 30,
"count": 2,
"prev": null,
"next": null
}
}
-
success Boolean
API call is executed successfully.
-
test_cases Array
This list has information about a specific test case.
-
case_type String
Type of the test case.
-
priority String
Proprity of the test case.
-
status String
Indicates the status of the test case.
-
folder_id Integer
ID of the test case folder.
-
issues Array
List of the linked Jira, Asana or Azure issues.
-
tags Array
Tags linked to the test case.
-
-
template String
Type of test case template, either text or step template.
-
description String
Brief information about the test case.
-
preconditions String
Any necessary setups or configurations before executing the test.
- Show 8 more
-
title String
Name of the test case.
-
identifier String
Unique test case identifier.
-
automation_status String
Indicates if test case is automated or not.
-
owner String
Email of the test run owner.
-
attachments Array
Any attachments in the test case.
-
steps Array
A set of step combinations and their corresponding results, which are outlined in a step template.
-
custom_fields String
The user defines the custom field with field names and their corresponding values.
-
info String
Additional pagination information.
-
page Integer
The current page being viewed displays a list of test cases.
-
page_size Integer
Number of test cases in the page.
-
count Integer
Total number of records across all pages.
-
prev Integer
Previous page number.
-
next Integer
Next page number.
-
Get the list of test cases based on specific test case IDs
Invoking this API will fetch the list of test cases based on specific test case IDs in a project. You will need the id
of the project to access and id
of test cases.
Request Parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://test-management.browserstack.com/api/v2/projects/PR-1/test-cases?id=TC-16667,TC-1046
-
project_id* String
Identifier of the project.
-
test_case_id* String
Identifier of the test case, used as a query parameter.
Response Attributes 200 OK
json
Response
{
"success": true,
"test_cases": [
{
"case_type": "Accessibility",
"priority": "Low",
"status": "Active",
"folder_id": 19590,
"issues": ["TASK-309"],
"tags": [
"link",
"Regression"
],
"template": "test_case_steps",
"description": "<p>test case description of verify location access.</p> <p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample description</span><img data-id=\"xyz123\"></p>",
"preconditions": "<p>a valid pre-condition text.</p>",
"title": "verify location access",
"identifier": "TC-16667",
"automation_status": "not_automated",
"owner": "john.doe@email.com",
"attachments": [
{
"size": "200 KB",
"name": "3.jpg",
"content_type": "image/jpeg",
"url": "https://teststack-stage.s3.amazonaws.com/media/genric/3/10334/8857111d-8b50-4e45-926b-c50fffd7a8d5?AWSAccessKeyId=AKIAWGP4IFPZPKMOIAG6&Expires=1707390465&Signature=f%2Bb8dbboIG20M51ZqT3Lx81Bk64%3D"
}
],
"steps": [
{
"step": "Launch the App",
"result": "Open the Android app on the device or emulator."
},
{
"step": "<p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample step</span><img data-id=\"xyz123\"></p>",
"result": "test"
},
{
"step": "Identify Location Feature",
"result": "Locate the feature or functionality within the app that requires location access (e.g., map view, search by location)."
},
{
"step": "Trigger Location Permission Request",
"result": "Verify the system permission request dialog appears for location access."
},
{
"step": "Select Permission Option",
"result": "Choose the desired permission option (e.g., Allow All the Time, Allow While Using the App, Deny)."
}
],
"custom_fields": [
{
"name": "estimate",
"value": "t1"
},
{
"name": "Automation Type",
"value": "Automation not required "
},
{
"name": "String-check",
"value": "test the login"
},
]
},
{
"case_type": "Accessibility",
"priority": "Low",
"status": "Active",
"folder_id": 19590,
"issues": [],
"tags": [
"a"
],
"template": "test_case_text",
"description": "",
"preconditions": "a valid pre-condition text.",
"title": "Verify Login Functionality",
"identifier": "TC-1046",
"automation_status": "not_automated",
"owner": null,
"attachments": [],
"steps": [],
"custom_fields": []
}
],
"info": {
"page": 1,
"page_size": 30,
"count": 2,
"prev": null,
"next": null
}
}
-
success Boolean
API call is executed successfully.
-
test_cases Array
This list has information about a specific test case.
-
case_type String
Type of the test case.
-
priority String
Proprity of the test case.
-
status String
Indicates the status of the test case.
-
folder_id Integer
ID of the test case folder.
-
issues Array
List of the linked Jira, Asana or Azure issues.
-
tags Array
Tags linked to the test case.
-
-
template String
Type of test case template, either text or step template.
-
description String
Brief information about the test case.
-
preconditions String
Any necessary setups or configurations before executing the test.
- Show 8 more
-
title String
Name of the test case.
-
identifier String
Unique test case identifier.
-
automation_status String
Indicates if test case is automated or not.
-
owner String
Email of the test run owner.
-
attachments Array
Any attachments in the test case.
-
steps Array
A set of step combinations and their corresponding results, which are outlined in a step template.
-
custom_fields String
The user defines the custom field with field names and their corresponding values.
-
info String
Additional pagination information.
-
page Integer
The current page being viewed displays a list of test cases.
-
page_size Integer
Number of test cases in the page.
-
count Integer
Total number of records across all pages.
-
prev Integer
Previous page number.
-
next Integer
Next page number.
-
Get the list of test cases based on specific attributes
Invoking this API will fetch the list of test cases based on specific attributes. You will need the id
of the project and based on specific attributes associated with test cases.
When requesting a list of test cases using the REST API, you can apply filters to get only the ones you want. Attributes-based filtering allows for selecting test cases by matching one or more attribute values passed as query parameters. The following table lists the available attributes.
Field | API query name | Example query |
---|---|---|
identifier | id | id=TC-16667,TC-1046 |
status | status | status=active,draft |
priority | priority | priority=high,low |
owner | owner | owner=test@bsstag.com |
type | case_type | case_type=regression,smoke |
custom fields | custom_fields | custom_fields[test]=a1,a2&custom_fields[estimate]=10,20 |
folder | folder_id | folder_id=10,11 |
tags | tags | tags=test,regression |
page | p | p=2 |
When you provide multiple values for the same query parameter, any one value must match the specified attributes. This means that an OR operator is applied within the query parameter. On the other hand, if you include multiple attribute values across different parameters, an AND operator is used across these different parameters. This requires all conditions to be met for a match.
Request Parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://test-management.browserstack.com/api/v2/projects/PR-1/test-cases?custom_fields[estimate]=test&custom_fields[automation type]=automated,test&case_type=functional&priority=medium&status=draft&folder_id=19590&p=2
-
project_id* String
Identifier of the project.
Response Attributes 200 OK
json
Response
{
"success": true,
"test_cases": [
{
"case_type": "Accessibility",
"priority": "Low",
"status": "Active",~
"folder_id": 19590,
"issues": ["TASK-309"],
"tags": [
"link",
"Regression"
],
"template": "test_case_steps",
"description": "<p>test case description of verify location access.</p> <p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample description</span><img data-id=\"xyz123\"></p>",
"preconditions": "<p>a valid pre-condition text.</p>",
"title": "verify location access",
"identifier": "TC-16667",
"automation_status": "not_automated",
"owner": "john.doe@email.com",
"attachments": [
{
"size": "200 KB",
"name": "3.jpg",
"content_type": "image/jpeg",
"url": "https://teststack-stage.s3.amazonaws.com/media/genric/3/10334/8857111d-8b50-4e45-926b-c50fffd7a8d5?AWSAccessKeyId=AKIAWGP4IFPZPKMOIAG6&Expires=1707390465&Signature=f%2Bb8dbboIG20M51ZqT3Lx81Bk64%3D"
}
],
"steps": [
{
"step": "Launch the App",
"result": "Open the Android app on the device or emulator."
},
{
"step": "Identify Location Feature",
"result": "Locate the feature or functionality within the app that requires location access (e.g., map view, search by location)."
},
{
"step": "<p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample step</span><img data-id=\"xyz123\"></p>",
"result": "test"
},
{
"step": "Trigger Location Permission Request",
"result": "Verify the system permission request dialog appears for location access."
},
{
"step": "Select Permission Option",
"result": "Choose the desired permission option (e.g., Allow All the Time, Allow While Using the App, Deny)."
}
],
"custom_fields": [
{
"name": "estimate",
"value": "t1"
},
{
"name": "Automation Type",
"value": "Automation not required "
},
{
"name": "String-check",
"value": "test the login"
},
]
},
{
"case_type": "Accessibility",
"priority": "Low",
"status": "Active",
"folder_id": 19590,
"issues": [],
"tags": [
"a"
],
"template": "test_case_text",
"description": "",
"preconditions": "a valid pre-condition text.",
"title": "Verify Login Functionality",
"identifier": "TC-1046",
"automation_status": "not_automated",
"owner": null,
"attachments": [],
"steps": [],
"custom_fields": []
}
],
"info": {
"page": 1,
"page_size": 30,
"count": 2,
"prev": null,
"next": null
}
}
-
success Boolean
API call is executed successfully.
-
test_cases Array
This list has information about a specific test case.
-
case_type String
Type of the test case.
-
priority String
Proprity of the test case.
-
status String
Indicates the status of the test case.
-
folder_id Integer
ID of the test case folder.
-
issues Array
List of the linked Jira, Asana or Azure issues.
-
tags Array
Tags linked to the test case.
-
-
template String
Type of test case template, either text or step template.
-
description String
Brief information about the test case.
-
preconditions String
Any necessary setups or configurations before executing the test.
- Show 8 more
-
title String
Name of the test case.
-
identifier String
Unique test case identifier.
-
automation_status String
Indicates if test case is automated or not.
-
owner String
Email of the test run owner.
-
attachments Array
Any attachments in the test case.
-
steps Array
A set of step combinations and their corresponding results, which are outlined in a step template.
-
custom_fields String
The user defines the custom field with field names and their corresponding values.
-
info String
Additional pagination information.
-
page Integer
The current page being viewed displays a list of test cases.
-
page_size Integer
Number of test cases in the page.
-
count Integer
Total number of records across all pages.
-
prev Integer
Previous page number.
-
next Integer
Next page number.
-
Create a test case
Invoking this API will create test cases programmatically, providing flexibility and automation in managing your test cycles.
To create a test case, you will need the id
of the project and id
of the folder in which the test case should be created.
Request Parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/{project_identifier}/folders/{folder_id}/test-cases
-
project_id* String
Identifier of the project.
-
folder_id* String
Identifier of the folder.
Request Body
Request Body
{
"test_case": {
"name": "verify submit button",
"description": "<p>Ensure that the submit button on the form submits the form data correctly and redirects to the expected page or displays the expected result.</p> <p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample description</span><img data-id=\"xyz123\"></p>",
"owner": "sam.r@email.com",
"preconditions": "<p>a valid pre-condition text.</p>",
"test_case_steps": [
{
"step": "Navigate to the form page",
"result": "The form page loads successfully"
},
{
"step": "<p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample step</span><img data-id=\"xyz123\"></p>",
"result": "test"
}
],
"issues": [
"Tm-443",
"TM-7565"
],
"issue_tracker": {
"name": "jira",
"host": "https://demo.atlassian.net"
},
"tags": [
"user",
"regression"
],
"custom_fields": {
"string custom": "sample_value_1",
"date custom": "07/04/1988",
"dropdown custom": "abc",
"url custom": "http://localhost.com"
}
}
}
-
name* String
Name of the test case.
-
description String
Brief information about the test case.
-
owner String
Email of the test case owner.
-
preconditions String
Any necessary setups or configurations before executing the test.
-
test_case_steps Array
List of applicable test case steps, where each step is a combination of the step and its result.
- Show 4 more
-
issues Array
List of the linked Jira, Asana or Azure issues.
-
issue_tracker Object
Ensures that issue IDs are correctly associated with their respective issue tracking tool, facilitating accurate linking and management.
-
name String
Specifies the issue tracking system to integrate with. For example, use
jira
for Jira,azure
for Azure DevOps, orasana
for Asana. -
host String
The base URL of your issue tracking system. For Jira Cloud instances, this typically follows the format
https://your-domain.atlassian.net
.
-
-
tags Array
Descriptive labels or keywords linked to the test cases.
-
custom_fields Object
The user-defined custom field with field names and their corresponding values.
Response Attributes 200 OK
json
Response
{
"data": {
"success": true,
"test_case": {
"case_type": "Other",
"priority": "Medium",
"status": "Active",
"folder_id": 23806,
"issues": [
{
"jira_id": "Tm-443",
"issue_type": "jira"
},
{
"jira_id": "TM-7565",
"issue_type": "jira"
}
],
"tags": [
"user",
"regression"
],
"template": "test_case_steps",
"description": "<p>Ensure that the submit button on the form submits the form data correctly and redirects to the expected page or displays the expected result.</p> <p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample description</span><img data-id=\"xyz123\"></p>",
"preconditions": "<p>a valid pre-condition text.</p>",
"title":"verify submit button",
"identifier": "TC-6655",
"automation_status": "not_automated",
"owner": "sam.r@email.com",
"steps": [
{
"step": "Navigate to the form page.",
"result": "The form page loads successfully".
},
{
"step": "<p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample step</span><img data-id=\"xyz123\"></p>",
"result": "test"
},
{
"step": "Click on the submit button.",
"result": "The form data is submitted and a loading indicator (if any) is displayed".
}
],
"custom_fields": [
{
"name": "string_custom",
"value": "built_in"
}
]
}
}
}
-
success Boolean
API call is executed successfully.
-
case_type String
Specifies the type of test case.
-
priority String
Indicates the priority level of the test case.
-
status String
Provides the current status of the test case.
-
folder_id String
Identifier of the Folder.
- Show 10 more
-
issues Array
List of the linked Jira, Asana or Azure issues.
-
template String
Defines the template type used in the API call. It can either be ‘steps’ for step-by-step templates or ‘text’ for textual templates.
-
description String
Brief information about the test case.
-
preconditions String
Any necessary setups or configurations before executing the test.
-
title String
Name of the test case.
-
identifier String
Identifier of the test case.
-
automation_status String
Status of the automation process, which should be one of the following values “automated”, “not_automated”, “cannot_be_automated”, “obsolete”, or “automation_not_required”.
-
owner String
Email of the test case owner.
-
steps Array
List of applicable test case steps, where each step is a combination of the step and its result.
-
custom_fields Object
List of the custom fields with field names and their corresponding values.
Create BDD test case
The create BDD test case API allows you to add a new BDD-style test case to your project. Use this endpoint to define features, scenarios, and optional background context for your BDD test cases.
Use this API to create a BDD test case by specifying the required fields. The API enforces that both feature and scenario are provided, and test_steps must not be included.
Request Parameters
Request
curl -X POST \
https://api.browserstack.com/projects/<project_id>/test-cases \
-H 'Content-Type: application/json' \
-d '{
"template": "test_case_bdd",
"feature": "Login Feature",
"scenario": "Valid user logs in",
"background": "User is on login page"
}'
-
project_id* string
The unique identifier of the project.
-
template* string
Must be set to ‘test_case_bdd’ to create a BDD test case.
-
feature* string
The feature name for the BDD test case.
-
scenario* string
The scenario description for the BDD test case.
-
background string
The background context for the BDD test case.
Response attributes 200
application/json
Response
{
"test_case": {
"id": "tc-123",
"template": "test_case_bdd",
"feature": "Login Feature",
"scenario": "Valid user logs in",
"background": "User is on login page",
"created_at": "2025-08-21T12:00:00Z",
"updated_at": "2025-08-21T12:00:00Z"
}
}
-
test_case Object
The created BDD test case object.
-
id string
Unique identifier for the test case.
-
template string
Template type, should be ‘test_case_bdd’.
-
feature string
The feature name for the BDD test case.
-
scenario string
The scenario description for the BDD test case.
-
background string
The background context for the BDD test case.
-
created_at string
Timestamp when the test case was created.
-
updated_at string
Timestamp when the test case was last updated.
-
Update a test case
Invoking this API allows you to update test cases in a given project. To update a test case, you will need both the id
of the project and the id
of the test case within that project.
Note: Only provide values for the fields you wish to update. If you include a field in the API call without specifying a value, that field will be set to null. All other fields will retain their existing values.
Request Parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X PATCH https://test-management.browserstack.com/api/v2/projects/{project_identifier}/test-cases/{test-case-id}
-
project_id* String
Identifier of the project.
-
test-case-id* String
Identifier of the test case.
Request Body
Request Body
{
"test_case": {
"name": "verify submit button",
"case_type": "Accessibility",
"priority": "Low",
"status": "Active",
"description": "<p>Ensure that the submit button on the form submits the form data correctly and redirects to the expected page or displays the expected result.</p> <p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample description</span><img data-id=\"xyz123\"></p>",
"owner": "sam.r@email.com",
"preconditions": "<p>a valid pre-condition text.<img data-id="23773"></p>",
"test_case_steps": [
{
"step": "Navigate to the form page",
"result": "The form page loads successfully"
},
{
"step": "Navigate to the form page <img data-id="23773">",
"result": "The form page loads successfully"
}
],
"issues": [
"Tm-443",
"TM-7565"
],
"issue_tracker": {
"name": "jira",
"host": "https://demo.atlassian.net"
},
"tags": [
"user",
"regression"
],
"custom_fields": {
"field_name 1": "fields value 1",
"field_name 2": "fields value 2",
"field_name 3": "fields value 3",
"field_name 4": "fields value 4"
},
"automation_status": "not_automated",
}
}
-
name String
Name of the test case.
-
case_type String
Type of the test case.
-
priority String
Proprity of the test case.
-
status String
Indicates the status of the test case.
-
description String
Brief information about the test case.
- Show 8 more
-
owner String
Email of the test case owner.
-
preconditions String
Any necessary setups or configurations before executing the test.
-
test_case_steps Array
List of applicable test case steps, where each step is a combination of the step and its result.
-
issues Array
List of the linked Jira, Asana or Azure issues.
-
issue_tracker Object
Ensures that issue IDs are correctly associated with their respective issue tracking tool, facilitating accurate linking and management.
-
name String
Specifies the issue tracking system to integrate with. For example, use
jira
for Jira,azure
for Azure DevOps, orasana
for Asana. -
host String
The base URL of your issue tracking system. For Jira Cloud instances, this typically follows the format
https://your-domain.atlassian.net
.
-
-
tags Array
Descriptive labels or keywords linked to the test cases.
-
custom_fields Object
The user-defined custom field with field names and their corresponding values.
-
automation_status String
Status of the automation process, which should be one of the following values “automated”, “not_automated”, “cannot_be_automated”, “obsolete”, or “automation_not_required”.
Response Attributes 200 OK
json
Response
{
"data": {
"success": true,
"test_case": {
"case_type": "Other",
"priority": "Medium",
"status": "Active",
"folder_id": 23806,
"issues": [
{
"jira_id": "Tm-443",
"issue_type": "jira"
},
{
"jira_id": "TM-7565",
"issue_type": "jira"
}
],
"tags": [
"user",
"regression"
],
"template": "test_case_steps",
"description": "<p>Ensure that the submit button on the form submits the form data correctly and redirects to the expected page or displays the expected result.</p> <p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample description</span><img data-id=\"xyz123\"></p>",
"preconditions": "The form fields are all filled with valid data.",
"title": "dsdasdasad",
"identifier": "TC-6655",
"automation_status": "not_automated",
"owner": "sam.r@email.com",
"steps": [
{
"step": "Navigate to the form page",
"result": "The form page loads successfully"
},
{
"step": "<p dir=\"ltr\"><span style=\"white-space: pre-wrap;\">sample step</span><img data-id=\"xyz123\"></p>",
"result": "test"
}
],
"custom_fields": [
{
"name": "string_custom",
"value": "signal"
}
]
}
}
}
-
success Boolean
API call is executed successfully.
-
case_type String
Specifies the type of test case.
-
priority String
Indicates the priority level of the test case.
-
status String
Indicates the current status of the test case.
-
folder_id String
Identifier of the Folder.
- Show 11 more
-
issues Array
List of the linked Jira, Asana or Azure issues.
-
tags Array
Descriptive labels or keywords linked to the test cases.
-
template String
Indicates the template type used in the API call. It can either be ‘steps’ for step-by-step template or ‘text’ for textual template.
-
description String
Brief information about the test case.
-
preconditions String
Shows any necessary setups or configurations before executing the test.
-
title String
Name of the test case.
-
identifier String
Identifier of the test case.
-
automation_status String
Status of the automation process, which should be one of the following values “automated”, “not_automated”, “cannot_be_automated”, “obsolete”, or “automation_not_required”.
-
owner String
Email of the test case owner.
-
steps String
List of applicable test case steps, where each step is a combination of the step and its result.
-
custom_fields Object
List of the custom fields with field names and their corresponding values.
Update BDD test case
The Update BDD test case API allows you to modify the feature, scenario, or background fields of an existing BDD test case. You can only update these fields if the test case uses the BDD template.
Use this API to update BDD fields for a test case. The API enforces that only BDD test cases can be updated, and test_steps cannot be modified for BDD test cases.
Request Parameters
Request
curl -X PATCH \
https://api.browserstack.com/projects/<project_id>/test-cases/<test_case_id> \
-H 'Content-Type: application/json' \
-d '{
"feature": "Login Feature",
"scenario": "Valid user logs in",
"background": "User is on login page"
}'
-
project_id* string
The unique identifier of the project.
-
test_case_id* string
The unique identifier of the test case.
-
feature string
The feature name for the BDD test case.
-
scenario string
The scenario description for the BDD test case.
-
background string
The background context for the BDD test case.
Response attributes 200
application/json
Response
{
"test_case": {
"id": "tc-123",
"template": "test_case_bdd",
"feature": "Login Feature",
"scenario": "Valid user logs in",
"background": "User is on login page",
"created_at": "2025-08-21T12:00:00Z",
"updated_at": "2025-08-21T12:10:00Z"
}
}
-
test_case Object
The updated BDD test case object.
-
id string
Unique identifier for the test case.
-
template string
Template type, should be ‘test_case_bdd’.
-
feature string
The feature name for the BDD test case.
-
scenario string
The scenario description for the BDD test case.
-
background string
The background context for the BDD test case.
-
created_at string
Timestamp when the test case was created.
-
updated_at string
Timestamp when the test case was last updated.
-
Bulk edit test cases
Invoking this API allows you to update multiple test cases in a given project. To update a test case, you will need both the id
of the project.
Note: Only provide values for the fields you wish to update. If you include a field in the API call without specifying a value, that field will be set to null. All other fields will retain their existing values.
Request Parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X PATCH https://test-management.browserstack.com/api/v2/projects/PR-21854/test-cases
-
project_id* String
Identifier of the project.
Request Body
Request Body
{
"test_case": {
"ids": [
"TC-10",
"TC-9"
],
"preconditions": "<p>a valid pre-condition text.</p>",
"issues": [
{
"issue_id": "Tm-443",
"issue_type": "jira"
},
{
"issue_id": "TM-7565",
"issue_type": "jira"
}
],
"issue_tracker": {
"name": "jira",
"host": "https://demo.atlassian.net"
},
"owner": "john.doe@email.com",
"tags": [
"user",
"regression"
],
"custom_fields": {
"field_name 1": "fields value 1",
"field_name 2": "fields value 2",
"field_name 3": "fields value 3",
"field_name 4": "fields value 4"
},
"automation_status": "automation_not_required",
"case_type": "Other",
"priority": "Medium",
"status": "Active"
}
}
-
ids* Array
Identifiers of the test cases.
-
preconditions String
Any necessary setups or configurations before executing the test.
-
issues Array
List of the linked issues.
-
issue_tracker Object
Ensures that issue IDs are correctly associated with their respective issue tracking tool, facilitating accurate linking and management.
-
name String
Specifies the issue tracking system to integrate with. For example, use
jira
for Jira,azure
for Azure DevOps, orasana
for Asana. -
host String
The base URL of your issue tracking system. For Jira Cloud instances, this typically follows the format
https://your-domain.atlassian.net
.
-
-
owner String
Email of the test case owner.
- Show 6 more
-
tags Array
Descriptive labels or keywords linked to the test cases.
-
custom_fields Object
The user-defined custom field with field names and their corresponding values.
-
automation_status String
Indicates if test case is automated or not. Status of the automation process, which should be one of the following values “automated”, “not_automated”, “cannot_be_automated”, “obsolete”, or “automation_not_required”.
-
case_type String
Specifies the type of test case.
-
priority String
Indicates the priority level of the test case.
-
status String
Specifies the current status of the test case.
Response Attributes 200 OK
json
Response
{
"success": true
}
-
success Boolean
API call is executed successfully.
Bulk edit test cases with specific operations
Invoking this API allows you to update multiple test cases in a given project. To update a test case, you will need the id
of the project.
Note: Only provide values for the fields you wish to update. If you include a field in the API call without specifying a value, that field will be set to null. All other fields will retain their existing values.
This API supports the following operators to control how field values are processed during bulk-edit requests.
Operator | Description |
---|---|
ignore |
Keep the existing value unchanged. |
replace |
Overwrite the current value with the provided value. |
add |
Append provided value(s) to the existing list (for multi-value fields). |
remove |
Remove specified value(s) from the existing list (for multi-value fields). |
Each field supports a subset of these operators based on its data type. Following table gives the information for each bulk-editable field, exactly which operation values are supported and what each does.
Field | Possible operators |
---|---|
automation_status |
ignore , replace
|
case_type |
ignore , replace
|
priority |
ignore , replace
|
state |
ignore , replace
|
owner |
ignore , replace
|
preconditions |
ignore , replace
|
tags |
ignore , add , remove , replace
|
issues |
ignore , add , remove , replace
|
custom_fields |
ignore , replace , add , remove
|
Request Parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X PATCH https://test-management.browserstack.com/api/v2/projects/PR-21854/test-cases/with-operations
-
project_id* String
Identifier of the project.
Request Body
Request Body
{
"ids": [
"TC-82679"
],
"test_case": {
"preconditions": {
"value": "<p>a valid pre-condition text.</p>",
"operation": "replace"
},
"issues": {
"value": [
{
"issue_id": "TM-2",
"issue_type": "jira"
}
],
"operation": "add"
},
"custom_fields": {
"user test": {
"value": "placeholder@email.com",
"operation": "replace"
},
"boolean": {
"value": "false",
"operation": "replace"
}
},
"tags": {
"value": [
"astro",
"redix"
],
"operation": "replace"
},
"automation_status": {
"value": "automation_not_required",
"operation": "replace"
},
"priority": {
"value": "Low",
"operation": "replace"
}
}
}
-
ids* Array
Identifiers of the test cases to update.
-
test_case* Object
Container for per-field update operations. Each key is the name of a test-case field, whose value is an object with value and operation properties.
-
preconditions String
Any necessary setups or configurations before executing the test.
-
issues String
List of the linked issues.
-
custom_fields String
Defines how to update one or more user-defined custom fields.
-
tags Array
Descriptive labels or keywords linked to the test cases.
-
automation_status String
Indicates if test case is automated or not. Status of the automation process, which should be one of the following values “automated”, “not_automated”, “cannot_be_automated”, “obsolete”, or “automation_not_required”.
-
priority String
Indicates the priority level of the test case.
-
Response Attributes 200 OK
json
Response
{
"success": true
}
-
success Boolean
API call is executed successfully.
Bulk edit BDD test cases
The bulk edit BDD test cases API allows you to update the feature, scenario, or background fields for multiple BDD test cases, all at once. Only test cases using the BDD template can be updated in bulk.
Use this API to update BDD fields for multiple test cases. The API returns updated test cases and errors for any test cases that are not BDD.
Request Parameters
Request
curl -X PATCH \
https://api.browserstack.com/projects/<project_id>/test-cases/bulk-edit \
-H 'Content-Type: application/json' \
-d '{
"test_case_ids": ["tc-101", "tc-102"],
"feature": "Checkout Feature",
"scenario": "User proceeds to payment",
"background": "Cart has items"
}'
-
project_id* string
The unique identifier of the project.
-
test_case_ids* array
List of test case IDs to update.
-
feature string
The feature name for the BDD test cases.
-
scenario string
The scenario description for the BDD test cases.
-
background string
The background context for the BDD test cases.
Response attributes 200
application/json
Response
{
"updated_test_cases": [
{
"id": "tc-101",
"template": "test_case_bdd",
"feature": "Checkout Feature",
"scenario": "User proceeds to payment",
"background": "Cart has items",
"created_at": "2025-08-21T12:00:00Z",
"updated_at": "2025-08-21T12:15:00Z"
}
],
"errors": [
{
"test_case_id": "tc-102",
"error": "Test case ID tc-102 is not a BDD test case. BDD fields can only be updated for BDD test cases."
}
]
}
-
updated_test_cases array
List of updated BDD test case objects.
-
id string
Unique identifier for the test case.
-
template string
Template type, should be ‘test_case_bdd’.
-
feature string
The feature name for the BDD test case.
-
scenario string
The scenario description for the BDD test case.
-
background string
The background context for the BDD test case.
-
created_at string
Timestamp when the test case was created.
-
updated_at string
Timestamp when the test case was last updated.
-
-
errors array
List of errors for test cases that could not be updated.
-
test_case_id string
The test case ID that could not be updated.
-
error string
The error message for the failed update.
-
Delete a test case
Invoking this API will delete a test case. You will need the id
of the project and id
of the test run to delete a test case.
Warning: Using the delete API call will permanently remove test cases. This action cannot be undone.
Request Parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X DELETE https://test-management.browserstack.com/api/v2/projects/PR-71521/test-cases/TC-1234
-
project_id* String
Identifier of the project.
-
test_case_id* String
Identifier of the test case.
Response Attributes 200 OK
json
Response
{
"success": true
}
-
success Boolean
API call is executed successfully.
Bulk delete test cases
Invoking this API will delete multiple test cases. You will need the id
of the project and id
of the test cases to delete.
Warning: Using the delete API call will permanently remove test cases. This action cannot be undone.
Request Parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X DELETE https://test-management.browserstack.com/api/v2/projects/PR-71521/test-cases
-
project_id* String
Identifier of the project.
Request Body
Request Body
{
"test_case": {
"ids": [
"TC-2151",
"TC-3277",
"TC-73561"
]
}
}
-
ids* Array
Identifiers of the test cases.
Response Attributes 200 OK
json
Response
{
"success": true
}
-
success Boolean
API call is executed successfully.
Export BDD test case
The Export BDD test cases API is a 3-step process:
- Start export: Initiate the export job (returns job metadata, not a file).
- Check export status: Poll for job status and download URL.
- Download export: Download the generated .feature or .zip file.
1. Start export
Use this API to start a BDD test case export job. The response contains the export job metadata and status URL.
Request Parameters
Request
curl -X POST \
https://api.browserstack.com/api/v2/projects/<project_id>/test-cases/export-bdd
-H 'Content-Type: application/json' \
-d '{
"test_case_ids": ["TC-16193", "TC-16194", "TC-15907"],
"combine_into_one": true,
"combined_feature": "My Awesome Feature"
}'
-
project_id* string
The unique identifier of the project.
-
test_case_ids* array
List of test case IDs to export.
-
combine_into_one boolean
If true, combine all scenarios into a single
.feature
file. -
combined_feature string
The feature name for the combined
.feature
file (required if combine_into_one is true). -
combined_background string
The background context for the combined
.feature
file.
Response attributes 200
application/json
Response
{
"success": true,
"export_id": 25,
"status": "pending",
"status_url": "https://<host>/api/v2/exports/25/status",
"warnings": [
"Selected test cases belong to different features or backgrounds.",
"Some test cases do not have the BDD template and will not be included in the export."
]
}
-
export object
Export job metadata and status URL.
-
success boolean
Indicates if the export request was accepted.
-
export_id integer
Unique identifier for the export job.
-
status string
Status of the export job (pending, processing, completed, failed).
-
status_url string
URL to check the status of the export job.
-
warnings array
List of warnings related to the export request.
-
2. Check export status
Endpoint:
GET /api/v2/exports/:export_id/status
Poll this endpoint to check the status of the export job. When status is completed
, the response includes a download URL.
Response attributes 200
application/json
Response (processing)
{
"success": true,
"status": "processing",
"export_id": 25,
"entity_type": "test_case",
"file_type": "bdd",
"url": null
}
Response (completed)
{
"success": true,
"status": "completed",
"export_id": 25,
"entity_type": "test_case",
"file_type": "bdd",
"url": "https://<host>/api/v2/exports/25/download"
}
Response (failed)
{
"success": true,
"status": "failed",
"export_id": 25,
"entity_type": "test_case",
"file_type": "bdd",
"url": null,
"error_message": "Something went wrong. Please contact support if issue persists."
}
-
export_status object
Export job status and download URL.
-
success boolean
Indicates if the status request was successful.
-
status string
Status of the export job (pending, processing, completed, failed).
-
export_id integer
Unique identifier for the export job.
-
entity_type string
The type of entity being exported (e.g., test_case).
-
file_type string
The type of file being exported (e.g., bdd).
-
url string
Download URL for the exported file (null if not ready).
-
error_message string
Error message if the export failed.
-
3. Download export
Endpoint:
GET /api/v2/exports/:export_id/download
When the export job is completed, use the download URL to fetch the generated file. The response is the file content (either a .feature file or a .zip archive).
Response
File download (.feature or .zip)
No response body is returned for file downloads.
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.