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
A set of name and their corresponding value of a custom field.
-
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
A set of name and their corresponding value of a custom field.
-
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
A set of name and their corresponding value of a custom field.
-
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.
-
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.