---
title: "AI Test Case Generation"
canonical: "https://docs.getxray.app/space/XRAYCLOUD/392921171/AI%20Test%20Case%20Generation"
format: markdown
---
> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> > Macro (toc)

> ℹ️ [AI Data Usage Policy](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/394395910)

# Introduction

Xray’s AI-powered Test Case generation feature is designed to accelerate and simplify the process of creating Test Cases from plain requirements. Whether you’re working with Manual or Cucumber Tests, this feature helps transform written inputs into structured, ready-to-review Test Cases - saving time and improving consistency across your Testing process.

With AI Test Case generation, teams can reduce manual work, onboard new Testers more effectively, and quickly generate high-quality Test drafts that align with real-world usage scenarios. It’s a powerful tool for bringing more speed and structure to Test design, right from the start.

This feature relies on AI Credits (please see more below).

## Key Benefits

- **Accelerating Test creation**: instantly generate draft Test Cases based on your input.
- **Improving consistency**: maintain a standard structure across Tests, especially in fast-paced or distributed team environments.
- **Reducing manual effort**: focus on refining and reviewing Tests instead of writing everything from scratch.
- **Supporting multiple Test types**: generate both manual and Cucumber Tests to match your project needs.
- **Ensuring traceability**: link generated Tests to requirements for clear coverage and auditability.
- **Staying in control**: you always review and approve the output - this feature supports your workflow (it doesn't replace it).

# Operations

## Enabling/Disabling/Permissions

### Configuring the Xray AI Hub

> ⚠️ - You must have [Xray already installed](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44566344) on your Jira Cloud instance.
> ⚠️ - The AI Test Script Generator is enabled by default, via the AI Hub default enablement (Figure 3), in the [Feature Toggle screen](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565845), at a Global Space level. You can use the instructions below to see how to enable/disable the AI Hub.
> ⚠️ - Available for Jira Admins only.

> Macro (rw-ui-steps-macro)
> 
> > Macro (rw-step)
> 
> ### Enablement/Disablement
> 
> In your Jira Cloud instance, go *Your apps* (Figure 1 - 1), select *Xray,* and use the ellipsis button (Figure 1 - 2),; then click *App settings* (Figure 1 - 2).
> 
> ![Figure 1 - Apps.png](media://0fb49d41-8e57-48a9-beca-e2f0deab92de)
> 
> 
> 
> > Macro (rw-step)
> 
> The Xray Features screen will open (Figure 2).
> 
> Click the AI Hub toggle (Figure 2 - 2) to enable/disable this feature.
> 
> ![Figure 2 - Settings](media://f075bdae-e6cb-4812-8f11-0f18098fe6d0)
> 
> > ℹ️ - When enabled, the **AI** **Test Case Generator is accessible by default only to users in Jira groups** that an administrator has safelisted. **If no Jira groups** are selected, the feature will remain **unavailable** to all users.
> > ℹ️ - The AI Hub can only be enabled/disabled at the Global level. Global Admins can select which user groups can use the AI Hub (or select all users). But the options apply equally to **all Spaces.**
> > ℹ️ - After enabling the AI Hub, you still need to configure permissions. More below.
> 
> > Macro (rw-step)
> 
> Click the *Configure…* button (Figure 2 - 1).
> 
> The AI Hub screen will open (Figure 3).
> 
> ![Figure 3 - AI Hub](media://6106b482-9ba5-40de-a44f-44e2d3292d63)
> 
> 
> Here (Figure 3), you can configure and enable/disable the features below using the toggles (Figure 3 - 2; 4):
> 
> - Generate Test Cases (Figure 3 - 1):
>   - Available for all users (Figure 3 - 1).
>   - Available for specific groups. You can use the dropdown menu to select the groups (Figure 3 - 1).
> - Generate Automation Scripts:
>   - Available for all users (Figure 3 - 3).
>   - Available for specific groups. You can use the dropdown menu to select the groups (Figure 3 - 3).
>   - Enable the option of *Include attachments from dependencies* (Figure 3 - 5).
> - Access Xray resourses to help you know more about the Xray AI features.

## Access

There are several entry points, via the [Xray Testing Board](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44567472) and a coverable Jira Work item.

### Via the Testing Board

> Macro (rw-ui-steps-macro)
> 
> > Macro (rw-step)
> 
> **Entry Point 1**
> 
> Access the Testing Board (Figure 4), and you will immediately see the *Test Cases* button (Figure 4 - 1). Click it to access AI Test Cases generation.
> 
> ![Figure 4 - Point 1](media://030f6a49-5204-458b-9390-0df12ce685ad)
> 
> 
> > Macro (rw-step)
> 
> **Entry Point 2**
> 
> Access the Testing Board (Figure 4) and, below the Test Repository entries, you will see the *Test Cases* button (Figure 5 - 1). Click it to access AI Test Cases generation.
> 
> ![Figure 5 - Point 2](media://cc885c7f-95ae-4f28-8346-3d4895876710)
> 
> > Macro (rw-step)
> 
> **Entry Point 3**
> 
> Access the Testing Board (Figure 6), click *Create* (Figure 6 - 1), and then click the *Test Cases* button (Figure 6 - 2). Click it to access AI Test Cases generation.
> 
> ![Figure 6 - Point 3.png](media://bb272a6b-2171-4534-bf0c-41a025e2539a)
> 
> > Macro (rw-step)
> 
> **Entry Point 4**
> 
> Access the Testing Board (Figure 7), click the ellipsis button (Figure 7 - 1), or right-click the Test Repository folder (Figure 7 - 2).
> 
> A box with options will appear. There, hover *Create* (Figure 7 - 3) and click the *Test Cases* button (Figure 7 - 4) to access AI Test Cases generation.
> 
> ![Figure 7 - Point 4](media://7063f436-cfda-42aa-8b99-60492b1e6098)
> 
> > Macro (rw-step)
> 
> **Entry Point 5**
> 
> Right-click a folder (Figure 8 - 1). A box with options will appear. There, hover *Create* (Figure 10 - 2) and click the *Test Cases* button (Figure 8 - 3) to access AI Test Cases generation.
> 
> ![Figure 8 - Folder](media://e72a8b1b-119a-4c98-bf9c-e470b633b02e)
> 
> > Macro (rw-step)
> 
> **Entry Point 6**
> 
> Create or select an empty folder: click *Create* (Figure 9 - 1) and then click the *Test Cases* button (Figure 9 - 2) to access AI Test Cases generation.
> 
> ![Figure 9 - Create](media://91fa7560-e7a9-4eea-8968-b019b14307d0)
> 
> ### Via a Coverable Issue
> 
> > ℹ️ When launching the AI Settings feature from a coverable Issue, the *Link Coverable Issues* field (Figure 12 - 3) will be pre-filled.
> 
> > Macro (rw-step)
> 
> **Entry Point 7**
> 
> E.g., Issue view panel. Click the *Test Cases* button (Figure 10 - 4) to access AI Test Cases generation.
> 
> ![Figure 10 - Point 5](media://5f8784e0-3ba1-41ee-b5b8-a5625a3237e1)
> 
> > Macro (rw-step)
> 
> **Entry Point 8**
> 
> E.g., Issue actions menu. Click *Add Tests* (Figure 11 - 1) and then the *Test Cases* button (Figure 11 - 2) to access AI Test Cases generation.
> 
> ![Figure 11 - Point 6](media://dfcd8ffc-350d-45e1-8921-39989c1205cf)

## Generating AI Test Cases

### Initial Feature Use - AI Acknowledgement

Each end user will see the following pop-up message (Figure 12) before their first use of the feature to double confirm their awareness of using AI.

Click *I agree* (Figure 12 - 1) to proceed.

![Figure 12 - Conditions](media://c357b342-f0da-4f74-94a1-18276610c6e8)

> ⚠️ Some end users, particularly if the [Xray Global setting for Usage Tracking](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44566331) is disabled, will not see the above pop-up warning. All users should be mindful when using the AI feature that they are interacting with a Large Language Model (LLM).

### Manual Tests

The process for generating AI Tests involves opening the AI Test Cases feature modal (Figure 13), filling in inputs, generating Test cases, and finally, viewing the generated Tests.

Includes structured [Test Steps](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565316) (Action, Data, Expected Result).

> Macro (rw-ui-steps-macro)
> 
> > Macro (rw-step)
> 
> On your Jira Cloud instance, enter the Testing Board and choose one of the entry points described in the section above, and click the *Test Cases* button.
> 
> A modal will open (Figure 13).
> 
> ![Figure 13 - Modal](media://02944d32-262e-4039-a460-0a5724c67a81)
> 
> > Macro (rw-step)
> 
> Here, you can:
> 
> - Select your Test Type (Figure 13 - 1; mandatory field).
> - Link [Preconditions](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565159) (Figure 13 - 2; optional field): link relevant Preconditions; only “summary” and “description” fields will be used as context.
> - Link Coverable Issues (Figure 13 - 3; optional field): add well-defined User Stories, Epics, or Issues that describe the functionality to be tested. When launching the AI Settings feature from a coverable Issue, the *Link Coverable Issues* field will be pre-filled. Only “summary” and “description” fields will be used in context.
> - Insert your Test Requirements (Figure 13 - 4; mandatory field): If linking detailed Coverable Issues, the Requirements value can be as simple as "Create sufficient test cases for the linked Issues”.
> 
> > ✅ Include (Figure 13 - 4) as much context as possible for better Test generation. Suggestions:
> > ✅ 
> > ✅ - Device/platform (e.g., iOS, Chrome, Windows).
> > ✅ - UX/UI interactions.
> > ✅ - Acceptance criteria.
> > ✅ - User roles/personas.
> > ✅ - Data dependencies.
> > ✅ - Edge/failure scenarios.
> > ✅ - Network/environment specs.
> > ✅ - Compliance/security constraints.
> > ✅ - Load and performance expectations.
> 
> - Add the maximum number of Test Cases (up to 60; Figure 13 - 6).
> 
> > Macro (rw-step)
> 
> Once you're finished filling in these fields, click *Generate Test Cases* (Figure 13 - 5) to proceed. You will see a progress bar, and your Test Cases will be instantaneously generated (Figure 14).
> 
> > Macro (rw-step)
> 
> Here (Figure 14), you can:
> 
> - Use the respective boxes (Figure 14 - 1) to select the Test/s you wish to review and edit. When you edit the title and description of selected Tests, the generator will update them in the next step and generate Tests based on your changes. More below.
> - Create subfolders from topics inside the destination folder by selecting the corresponding box (Figure 14 - 2).
> 
> ![Figure 14 - Tests](media://456a51c9-e02b-406e-8a01-6557b442fc47)
> 
> > ℹ️ At this point, the fields on the right (Figure 14 - 3) can't be changed.
> > ℹ️ 
> > ℹ️ However, you can reset the process by clicking *Start Over* (Figure 14 - 4). If you do so, you will see a confirmation modal (Figure 15).
> > ℹ️ 
> > ℹ️ Click *No, stay* (Figure 15 - 3) to go back to the stage depicted in Figure 14, or *Start Over* (Figure 15 - 2) to restart the whole process: this clears all inputs and selections.
> > ℹ️ 
> > ℹ️ ![Figure 15 - Modal](media://d93adf39-d457-4e42-a954-c12e1e26c8f4)
> 
> > Macro (rw-step)
> 
> To proceed with the Test Case generation, click *Review & Edit* (Figure 14 - 5). You will see a progress bar, and your Test Cases will be instantaneously listed (Figure 16 - 1).
> 
> Once the Tests are listed (Figure 16 - 1), select the Tests you wish to edit/review by checking the corresponding box (Figure 16 - 2).
> 
> ![Figure 16 - Tests](media://81fa596e-3ac7-4ae5-a422-0092a4eb6e1b)
> 
> 
> > Macro (rw-step)
> 
> Start by reviewing the *Details* (Figure 17). Here, you can edit the Test *Summary* (Figure 17 - 1) and its *Description* (Figure 17 - 2).
> 
> ![Figure 17 - Details](media://8c05748b-3c80-4ec8-b612-09e54ee61f45)
> 
> > Macro (rw-step)
> 
> Click *Step* (Figure 18 - 1) to open the Step screen (Figure 18) and edit it (Figure 18 - 2).
> 
> ![Figure 18 - Step](media://44f0925b-d865-4638-bfcd-e4187f501924)
> 
> > Macro (rw-step)
> 
> Click *Configure Fields* (Figure 19 - 3) to open the respective screen (Figure 19) and edit its fields.
> 
> ![Figure 19 - Fields](media://6016b0d0-9e90-43f8-af39-73318cb501db)
> 
> Here, you can select, using the dropdown menus:
> 
> - The Folder path (Figure 19 - 1).
> - The Parent (Figure 19 - 2).
> - The Priority (Figure 19 - 3).
> - Labels (Figure 19 - 4). By default, all AI-generated Tests are tagged with the label "AI".
> 
> Once you're finished, click *Create Tests* (Figure 19 - 5).
> 
> > Macro (rw-step)
> 
> You will see a progress bar, and your Test Cases will be instantaneously generated, taking you back to the Testing Board (Figure 20).
> 
> ![Figure 20 - Confirmation](media://46ff8d56-f852-4334-866b-794d6f3bc5af)
> 
> A success message (Figure 19 - 1) will confirm how many Test Cases were generated.
> 
> > ℹ️ You can also click the *Share Feedback* button (Figure 20 - 2) to provide feedback. If you do, a modal will open (Figure 21).
> > ℹ️ 
> > ℹ️ Use the dropdown menu (Figure 21 - 1) to select a topic, write your message with your feedback (Figure 20 - 2; mandatory field), and once you're finished, click *Submit* (Figure 21 - 3).
> > ℹ️ 
> > ℹ️ ![Figure 21 - Feedback](media://dd002cae-3c80-444c-a2dc-28b86c776958)
> > ℹ️ 
> > ℹ️ ![Figure 22 - Feedback](media://08d28106-7917-46f9-9c62-d15b9275ea2c)
> > ℹ️ 
> > ℹ️ You will see a success message confirming your feedback submission (Figure 22 - 1).
> 
> > ℹ️ Your feedback will be reviewed by the Xray team, and no customer data is used to train the  LLM.


- Since the results are generated from an LLM, the same input may very well result in different outputs each time. Although it is usually similar.
- You can regenerate Tests with the same input if you’re not happy with the results.
- All generated Tests are editable before creation, and you can select which of the generated Tests to create input from.
- Please review all generated Tests carefully before publishing them.

### Cucumber Tests

[Gherkin](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565320)-based scenarios.

The process of creating Cucumber Tests using the Xray AI Test Case generating feature is the same as the one using Manual Tests (described above).

The only difference is when in the Generate Test Cases AI modal (Figure 23), in the *Test Type* field, you must select *Cucumber* (Figure 23 - 1).

Then proceed as described in the Manual Test section above.

## Error Messages

### AI Service Not Available

> Macro (rw-ui-steps-macro)
> 
> > Macro (rw-step)
> 
> This error happens if the AI Settings feature is not enabled.
> 
> To replicate the "AI service not available" error, on your Jira Cloud instance, as explained above, go to the Testing Board. Then, click the *Test Cases* button (Figure 24 - 1) to display the Generate Test Cases modal (Figure 23).
> 
> ![Figure 23 - Test Cases](media://3cf52c99-12fe-4012-b948-d34926e6d8aa)
> 
> > Macro (rw-step)
> 
> While the Generate Test modal is open (Figure 23), open a new tab and go to Apps > Xray > Features. From there, disable the *AI Settings* feature using its toggle (Figure 24 - 1).
> 
> ![Figure 24 - Toggle](media://14ff5c14-7638-4958-941b-d306b994be4b)
> 
> > Macro (rw-step)
> 
> Now, return to the Generate Test Cases modal (Figure 23) and click the *Generate Test Cases* button (Figure 23 - 2). This action will now display an error message (Figure 25 - 1).
> 
> ![Figure 25 - Error.png](media://a0dfa461-ba3e-4340-8d70-4eaef1474f7c)

## Using the Generated Tests

All created Tests:

- Include the "AI" label (unless modified).
- Are placed in the root of the Test Repository (unless the folder path is defined).

You can use this label or path to filter or incorporate the Tests into further processes or automation.

> ✅ - You can generate **up to 60 Test cases per request.**
> ✅ - Test cases are generated in the same language as the input text, unless explicitly stated otherwise in the requirements.
> ✅ - The process is iterative: tweak, refine, and regenerate as needed.
> ✅ - It's a great tool for improving Test coverage on User Stories.

## Spotlight

The Spotlight feature (Figure 26 - 1) is accessible whether you click the Test Cases button in the Testing Board or a coverable Issue.

It's a pop-up with information about the AI Settings feature. You can close it by clicking *Dismiss* (Figure 26 - 2) and/or access this documentation page by clicking *Learn More* (Figure 26 - 3).

![Figure 26 - Spotlight](media://4a6c5b78-5519-4595-bfd4-3ec85e62f188)


> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> If you have questions or technical issues, please [contact the Support team via the Customer Portal (Jira service management)](https://jira.getxray.app/servicedesk/customer/portal/2/user/login?destination=portal%2F2%2Fcreate%2F28) or [send us a message using the in-app chat](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44577312).