TestKase
TestKase
|Docs
Test ManagementAI & Advanced

AI Test Case Generation

Generate comprehensive test cases from natural language descriptions using AI.

AI Test Case Generation

The AI test case generation feature creates comprehensive, well-structured test cases from a natural language description of the feature or scenario you want to test. This is the fastest way to bootstrap a test suite for a new feature.

How to Generate Test Cases

  1. Navigate to the Test Cases tab in your project.
  2. Open the New dropdown in the toolbar and choose Create with AI.
  3. Choose where the requirement comes from:
    • Paste Requirement — type or paste a description of the feature you want to test.
    • Linked Requirement — pick a requirement already in the project and generate from it. Be as specific as possible. For example:
    • "User login with email and password, including validation for empty fields, invalid email format, incorrect password, account lockout after 5 failed attempts, and successful login redirect to dashboard"
    • "Shopping cart that supports adding items, updating quantities, removing items, applying discount codes, and calculating tax based on shipping address"
  4. Choose which Fields the AI should fill. Title is always generated; you can toggle Summary, Precondition, Expected Result, Test Data and Priority.
  5. Choose the Number of test cases to generate. This is required — pick a value between 1 and 10.
  6. Click Generate. The AI processes your description and produces test cases.
  7. Review the generated test cases in the preview. Each contains a title plus the fields you selected. Where the tester needs to perform a sequence of actions, those actions are written into the Summary as prose.
  8. Edit any test cases that need adjustment (modify titles, change priority, rewrite the summary).
  9. Tick the test cases you want to keep — Select All takes the lot — and click Submit (N) to add them to your project. Regenerate discards the batch and runs the generation again, which costs credits a second time.

AI generation does not populate the structured Test Steps table. Generated cases carry only the fields listed above; if you want discrete numbered steps with per-step expected results, add them by hand after saving.

Limits

LimitValueWhat happens
Requirement length5,000 charactersThe modal does not stop you pasting more, but generation fails with "Requirement must not exceed 5000 characters. Current length is N characters." Trim the spec to the part you want tested, or generate in sections.
Test cases per request1 to 10The field is required and defaults to 5. To produce more than 10, run the generation again — but see the note below on cost.
Response size16,384 tokensThe model's reply is capped, whether you asked for 1 test case or 10. If the reply is cut off mid-way the result cannot be read and generation fails with "Something went wrong while generating the AI response. Please try again." — ask for fewer cases, or untick fields you do not need. No credits are charged when this happens.
CreditsToken-basedCharged on the tokens sent and returned. Asking for 10 cases in one request is much cheaper than ten single-case requests, because your requirement and the instructions are sent once. See What an AI Action Costs.

When your organization's credit balance reaches zero, generation is refused with a message that depends on the plan — a paid organization is told "You've used this month's AI credits. They refresh on the 1st, or add seats to raise your monthly allowance.", and a free organization "You've used your free AI credits. To use additional AI credits, upgrade to a Premium plan." If the owner has switched AI off entirely, it fails with "AI features are temporarily unavailable..." instead. See AI Privilege & Quality Settings.

Always review AI-generated test cases before saving. While the AI produces high-quality output, it may miss domain-specific edge cases or business rules that only your team knows.

Generation Tips

The quality of AI-generated test cases depends heavily on the quality of your input description. Here are tips to get the best results:

Write Specific Descriptions

Instead of...Try...
Test the login pageTest user login with email/password including empty field validation, invalid credentials, account lockout, remember me, and forgot password link
Test the checkoutTest e-commerce checkout flow: guest vs logged-in, credit card and PayPal, address validation, order summary, email confirmation
Test user settingsTest user profile settings: update display name, change email with verification, upload avatar (JPEG/PNG, max 5MB), change password requiring current password, delete account with confirmation

Include Boundary Conditions

Mention edge cases, error states, and boundary conditions in your description. The AI will generate test cases covering these scenarios:

  • Input limits (min/max values, character limits, file sizes)
  • Error handling (network failures, server errors, invalid data)
  • Permission scenarios (unauthorized access, expired sessions)
  • Concurrent operations (multiple users, race conditions)

Specify the Testing Focus

If you want the AI to focus on specific areas, mention them explicitly:

  • "Focus on negative testing" — generates more error and invalid input scenarios
  • "Focus on security testing" — generates XSS, injection, and auth bypass scenarios
  • "Focus on accessibility" — generates keyboard navigation, screen reader, and ARIA scenarios
  • "Focus on performance" — generates load, timeout, and concurrency scenarios

You can generate test cases in batches. Start with a high-level description for broad coverage, then run additional generations focused on specific areas (security, edge cases, etc.) to deepen coverage.