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.
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": "test case description of verify location access.",
"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": "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 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": "test case description of verify location access.",
"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": "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 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": "test case description of verify location access.",
"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": "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 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 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": "Ensure that the submit button on the form submits the form data correctly and redirects to the expected page or displays the expected result.",
"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"
}
],
"issues": [
"Tm-443",
"TM-7565"
],
"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.
-
issues Array
List of the linked Jira issues.
-
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": "Ensure that the submit button on the form submits the form data correctly and redirects to the expected page or displays the expected result.",
"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": "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 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.
Update 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",
"description": "Ensure that the submit button on the form submits the form data correctly and redirects to the expected page or displays the expected result.",
"owner": "sam.r@email.com",
"preconditions": "The form fields are all filled with valid data.",
"test_case_steps": [
{
"step": "Navigate to the form page",
"result": "The form page loads successfully"
}
],
"issues": [
"Tm-443",
"TM-7565"
],
"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.
-
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 issues.
-
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": "Ensure that the submit button on the form submits the form data correctly and redirects to the expected page or displays the expected result.",
"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"
}
],
"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 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.
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 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/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": [
{
"jira_id": "Tm-443",
"issue_type": "jira"
},
{
"jira_id": "TM-7565",
"issue_type": "jira"
}
],
"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 Jira issues.
-
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.
- Show 4 more
-
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.
Delete 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" \
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 case
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" \
https://test-management.browserstack.com/api/v2/projects/PR-71521/test-case
-
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.
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.