Quick Start: Generate Test Cases with AI

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.

ℹ️ The AI feature is available in TestRail Cloud only.

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.

⚠️ Warning
Misuse of AI (e.g. prompt injection or generating deceptive content) may result in restricted access and is a violation of the AI Terms of Use and Responsible AI Use Guide.
admin-ai-hub-settings.jpg

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.

project setting.webp
  • User role level - control access to AI features for specific roles.

user_role.webp

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.

Screenshot 2025-10-29 at 10.09.41.png


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)
ℹ️ Test Case Descriptions are not mapped by default. If you'd like the AI to populate the description field, you need to create a custom text field or manually configure the mapping to an existing one. Only users with permission to manage custom fields can do this.

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:

  1. Steps + Expected Results

    • Test Case Step (AI-Generated) → text

    • Expected Result (AI-Generated) → text

  2. Steps + Expected Results + Description

    • Test Case Step (AI-Generated) → text

    • Expected Result (AI-Generated) → text

    • Test Case Description (AI-Generated) → text

  3. BDD Scenario

    • Test Case BDD (AI-Generated) → scenario

  4. BDD Scenario + Description

    • Test Case BDD (AI-Generated) → scenario

    • Test Case Description (AI-Generated) → text

  5. Steps/Results

    • Test Case Step/Results (AI-Generated) → steps

  6. Steps/Results + Description

    • Test Case Step/Results (AI-Generated) → steps

    • Test Case Description (AI-Generated) → text

⚠️ Warning
If a template includes any other combination of AI-mapped fields, it will not appear in the AI modal.

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

💡 Tip 1
The more context you provide, the better the TestRail AI can generate precise, relevant, and high-quality test cases. For more information please read How to Get the Best Results from TestRail’s AI Test Case Generator .
💡 Tip 2
If you want to generate test cases in a language other than English (for example, Spanish), make sure to enter your requirements in that language. The generated test cases will follow the language of your input.
💡 Tip 3
If you want AI to focus on a specific type of test case (for example, edge cases or security tests), simply mention it in the requirements field. .
Screenshot 2025-09-09 at 11.24.43.png

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.

generator-step2.jpg

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.

⚠️ Warning
Previously selected test cases won’t carry over. You’ll need to review the new list and make your selections again.
generator-step2-edit.jpg

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.

  1. Click "Generate Test Cases" to send selected cases to AI for full generation.

  2. AI will generate test cases and automatically fill in the mapped test case fields for each response.

  3. 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.

👉 Start learning now

1679917783_TestRail_Academy_Course_Banner_Image.png

Was this article helpful?
49 out of 64 found this helpful