Generate test cases using AI
Learn how AI can assist you with creating test cases in BrowserStack Test Management.
Manually creating test cases can be complex and time-consuming. To simplify this task, BrowserStack Test Management offers AI-powered test case generation. Now, you can leverage generative AI to swiftly generate meaningful test cases based on the context you provide, accelerating your testing process and ensuring comprehensive coverage.
Key features
-
Save time:
Quickly generate test cases without the manual effort of authoring test cases. -
Enhanced coverage
You can ensure all scenarios are tested by using AI suggestions. -
Flexible input options to provide context
Use input context to generate test cases through prompts and requirement files.
BrowserStack does not train its AI models on the data you provide.
Generate AI-powered test cases
Our AI-powered test case generation helps you create comprehensive and well-structured test cases quickly. You can generate test cases in plain English or in the BDD Gherkin format to align with your development practices.
You can now generate test cases in three ways:
- Quick prompt from the listing view: Fastest way to add cases without leaving the page.
- From the Create Test Case dialog: Compose a clear and concise title of the feature or user story you want to test.
- From requirement documents, images or a prompt: From an existing requirement with more context (PRD/images, Jira, links, destination, format).
- When BDD test cases are selected, the generator returns Feature/Scenario style output using Given / When / Then.
- Currently, only one JIRA ID can be submitted per request.
- Context from attachments is ignored when generating test cases from a JIRA issue.
Quick-generate from the test cases listing view
This method is the fastest way to generate test cases from a simple prompt. You can describe the feature you want to test directly from the test case list view, and the AI will create the test cases for you.
- Navigate to the desired test case folder in your project.
- Locate the AI prompt field at the bottom of the test case list.
- Select the output format for your test cases. You can choose between plain English and BDD (Gherkin).
- Enter a clear and concise description of the feature or user story you want to test.
- Press Enter or click Create next to the prompt field.
Review the suggestions and make edits if needed before adding the cases to the current folder.
Tips for better results
- Keep one clear intent per prompt (feature, user story, or behavior).
- Prefer action verbs and expected outcomes.
- If you need domain context, use the dialog method below to attach requirement docs/images/links.
Generate from the create test case dialog
Using the Create Test Case dialog gives you more control. It allows you to provide additional context, such as a detailed summary and preconditions. It helps the AI generate more precise test cases. This method is ideal for complex features or when you need to specify detailed requirements.
To create a test case:
- Click Create Test Case from the dashboard.
- Enter the test case Title (required).
- Select a template from the Choose Template dropdown:
- Text
- Steps
- Gherkin (BDD)
For detailed guidance on each template, refer to How to use templates.
-
Click Generate icon next to the title field.
- The AI populates all the relevant fields based on the template you chose in step 3.
- Review the generated content and make any necessary edits.
- Click Create to generate and save the new test case.
This process lets you leverage AI to do the heavy lifting while giving you the final say on the test case details.
From an existing requirement
You can also generate test cases directly from an existing requirement, such as a Jira issue or an internal user story. This method ensures you can trace your tests back to the original requirement.
To generate detailed test cases based on what you want to test:
- Navigate to the test cases list view in your project and select an existing test case folder or create a new one.
- Click Generate with AI.
- On the generation screen, you need to provide input to the AI to generate test cases. You can do this by:
-
Uploading a requirements file (See annotation 1):
- Upload a requirements document (example, a PDF file) containing detailed requirements specifications.
- This file is attached to each generated test case.
- You can provide both a prompt and a requirements document for more comprehensive input.
-
Use Jira issue context (See annotation 2):
- Click on Add Jira ID.
- Enter the Host, Project and issue ID to fetch context from the issue description.
For details on how to link Jira issues, see Link Test Cases with Jira Requirement Issues.
-
Using a prompt (See annotation 3):
- Enter a detailed description of the test case scenarios you need. The prompt has a character limit of 30,000 characters.
-
Choose the destination folder where accepted AI-generated test cases will be saved (See annotation 4):
- Click the folder icon next to the folder name at the bottom of the modal window.
- From the displayed folder structure, select the desired folder.
- By default, the test cases will be saved in the currently selected folder. You can change the folder at any time before generating test cases.
-
Uploading a requirements file (See annotation 1):
- Choose the output format for your test cases from the dropdown menu beside Generate button.
- Test cases with steps: Creates comprehensive test cases complete with preconditions and detailed, step-by-step instructions.
- Test cases without steps: Generates concise cases with Title, Description, Priority, State, and Type of test case.
- BDD test cases: Generates test scenarios using the Gherkin Given/When/Then structure.
- Click Generate button.
- The AI generates test cases across scenarios, with all test cases selected by default and categorized accordingly.
- After test case generation completes, review the generated results.
- If you selected Test cases with steps or Test cases without steps, the AI groups your test cases into scenarios. On the review screen, you can perform the following actions:
- Expand a scenario: Click the arrow (>) next to the scenario to see its individual test cases.
- Review test cases: Deselect any test case you do not need by unchecking its box.
-
View test case details: Click View besides a generated test case to view test case details and make inline edits.
- Add individually: Click Add next to a specific case.
- If you selected BDD test cases, the AI groups your BDD scenarios into features. On the review screen, you can perform the following actions:
- Expand a feature: Click the arrow (>) next to the feature to see its individual test cases.
- Review test cases: Deselect any test case you do not need by unchecking its box.
- View test case details: Click View besides a generated test case to view test case details and make inline edits.
-
Add individually: Click Add next to a specific case.
- If you selected Test cases with steps or Test cases without steps, the AI groups your test cases into scenarios. On the review screen, you can perform the following actions:
- Add to your repository:
- Add to destination folder: Adds the selected test cases directly to destination folder.
-
Create subfolders and add: Organizes results into subfolders inside the destination folder:
- For Test cases with/without steps: one subfolder per Scenario.
- For BDD test cases: one subfolder per Feature.
- Click Add Test Cases to include the selected test cases in your suite.
- To discard and start over, click Start Over and choose any method to regenerate test cases.
You have now successfully generated a comprehensive set of test cases linked directly to your requirement, ensuring your testing is aligned with your project goals.
Test case details are generated asynchronously and may take some time.
BrowserStack AI performs best with PRD’s that are well-structured, detailed, and unambiguous. For optimal performance, adhere to the following PRD constraints:
- Maximum pages: 25
- Maximum size: 15 MB
- Supported formats: PDF, txt
When you upload an image, ensure it meets the following requirements to avoid errors:
- Maximum image size: 5 MB
- Supported formats: JPEG, JPG, PNG
Files that exceed either limit are rejected and test-case generation will not begin. Split or compress larger PRD’s before uploading.
Now, you have successfully generated and added AI-powered test cases with detailed test case details to your test case repository, tailored to your specific requirements and context.
The following image shows an example of an AI-generated test case along with its details.
Example of an AI-generated BDD test case
The following image shows an example of an AI-generated BDD test case along with its details.
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
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!