TestRail’s AI-powered test case generation helps teams quickly create structured and comprehensive test cases. Before users can access this feature, admins must first enable AI, configure permissions, and set up field mappings. Follow this guide to get started.
Disabling and enabling the feature
TestRail Admins can enable or disable Generate test cases with AI for the entire instance from the AI Hub under the AI Settings tab.
Managing AI Access & Permissions
TestRail provides granular access controls for AI-powered features, allowing organisations to tailor AI usage to their needs:
Project level - to enable or disable AI within individual projects.
User role level - control access to AI features for specific roles.
Enable Test Case templates in Generate with AI
TestRail uses field mapping to ensure AI-generated content is placed in the correct case fields.
By default, standard TestRail fields are already mapped to AI responses.
If your templates use custom case fields, you’ll need to manually map them to AI responses to ensure the generated content appears in the right place.
Supported case field types include:
Case Field Type |
Default AI Mapping |
| Steps (steps_separated) | Step & Result (AI-Generated) |
| Steps (steps) | Step (AI-Generated) |
| Expected Result (expected) | Expected Result (AI-Generated) |
| BDD Scenarios (testrail_bdd_scenario) | Test Case BDD (AI-Generated) |
| Text | Test Case Description (AI-Generated) |
For custom templates, here are the available mapping options:
Case Field Type |
Available AI Mapping |
Text |
Description, Step, Expected Result |
Scenarios |
BDD Scenario |
Steps |
Step & Result |
Valid template combinations for AI test case generation
To make a test case template available in the Generate test cases with AI modal, it must use one of the supported AI-mapped field combinations below:
-
Steps + Expected Results
Test Case Step (AI-Generated) →
textExpected Result (AI-Generated) →
text
-
Steps + Expected Results + Description
Test Case Step (AI-Generated) →
textExpected Result (AI-Generated) →
textTest Case Description (AI-Generated) →
text
-
BDD Scenario
Test Case BDD (AI-Generated) →
scenario
-
BDD Scenario + Description
Test Case BDD (AI-Generated) →
scenarioTest Case Description (AI-Generated) →
text
-
Steps/Results
Test Case Step/Results (AI-Generated) →
steps
-
Steps/Results + Description
Test Case Step/Results (AI-Generated) →
stepsTest Case Description (AI-Generated) →
text
Generating Test Cases with AI
Define Requirements
Select a Section where AI-generated test cases should be saved.
Select a test case Template with the case fields mapped for AI reponses
Enter Product Requirements in the language you want your test cases to be generated
Click “Continue” to proceed
Review, Edit, and Select Test Cases
Once you share your requirements, the AI generates a list of test case titles and descriptions only. This early review stage is deliberate: it keeps you in the loop at the most critical moment. Because AI is probabilistic, it may make assumptions and it’s much faster to spot and correct them at the title and description level than after full cases are generated.
At this stage, you can:
Edit titles and descriptions to correct assumptions or clarify intent.
Repurpose suggestions by shifting their focus without having to regenerate.
Exclude test cases by leaving them unselected. Only your chosen ones will be completed with steps and results.
Regenerate by adjusting your requirements if the initial suggestions don’t reflect your intent.
This workflow ensures AI is always working under your guidance, saving time, improving accuracy, and reducing unnecessary rework.
Regenerate Test Cases
Regenerating test cases is useful when your initial input lacks details or clarity, causing Testrail AI to generate incorrect or incomplete test cases. Instead of manually editing each one, you can update the requirements and let the TestRail AI generate a more accurate set. Click "Edit Requirements" to modify the input and regenerate test cases.
Generate Test Cases
Once you're satisfied with the selected test cases, you can proceed with full test case generation. AI will expand on your selections by generating detailed steps and expected results, ensuring each test case is complete and ready for execution.
Click "Generate Test Cases" to send selected cases to AI for full generation.
AI will generate test cases and automatically fill in the mapped test case fields for each response.
Test cases will be saved in the selected Section.
When teams use Generate test cases with AI, administrators can rely on Audit Logs (Enterprise feature) to track all AI-related actions, including creation, updates, and deletions of AI-generated test cases. This ensures full traceability of AI usage within the instance, supporting compliance with organisational policies and external regulatory requirements. For setup and configuration details, see the Audit Logs documentation.
Reviewing AI-Generated Test Cases
Once AI-generated test cases are saved, they become part of your test case repository and can be managed like any other test case in TestRail. You can edit, duplicate, delete, include them in test runs, and follow approval workflows based on your team's processes. This ensures AI-generated test cases seamlessly integrate into your existing test management workflow without disrupting established practices.
🎓 Level up your AI skills with TestRail Academy!
Explore free, self-paced courses to get the most out of TestRail.