Skip to main content

Overview

AI Test Generation allows you to create complete, ready-to-run test cases by describing your testing goals in natural language. The AI analyzes your description and generates appropriate test steps, including navigation, interactions, and assertions.

How It Works

  1. Describe your test: Write what you want to test in plain English
  2. AI analyzes: The system interprets your intent and identifies required steps
  3. Steps generated: Complete test steps are created with appropriate locators
  4. Review and refine: Edit generated steps as needed before running

Getting Started

From the Dashboard

  1. Click New Test or use the + button
  2. Select Generate with AI
  3. Enter your test description
  4. Click Generate
  5. Review and save the generated test

From AI Chat

  1. Open the global AI Chat
  2. Describe the test you want to create
  3. The AI generates test steps
  4. Save as a new test case

Writing Effective Descriptions

Structure Your Description

Include these elements for best results:
  • Starting point: Where the test begins
  • Actions: What steps to perform
  • Verifications: What to check or assert
  • Test data: Specific values to use

Example Descriptions

Basic Login Test:
Test user login on myapp.com:
- Navigate to the login page
- Enter email "[email protected]"
- Enter password "password123"
- Click the Sign In button
- Verify the dashboard page loads
- Verify "Welcome back" message is displayed
Form Submission Test:
Test the contact form submission:
- Go to /contact
- Fill in name field with "John Doe"
- Fill in email with "[email protected]"
- Fill in message with "Test inquiry message"
- Click Submit
- Verify success message "Message sent successfully" appears
E-commerce Flow:
Test adding items to cart on an e-commerce site:
1. Navigate to the products page
2. Click on the first available product
3. Select quantity 2
4. Click Add to Cart
5. Verify cart badge shows "2"
6. Go to cart page
7. Verify product appears in cart with correct quantity

Generated Step Types

AI Test Generation creates various step types based on your description:
Description ElementGenerated Step Type
”Go to”, “Navigate to”Navigate
”Click”, “Press”, “Select”Click
”Enter”, “Type”, “Fill”Fill
”Verify”, “Check”, “Assert”Verify Text/Visibility
”Wait for”Wait for Navigation/Element
”Upload”File Upload
”Select option”Select Option

Customizing Generated Tests

Adding Environment Variables

Generated tests use hardcoded values by default. Replace with environment variables: Before:
Navigate to: https://myapp.com/login
After:
Navigate to: {{ env.BASE_URL }}/login

Improving Locators

AI generates locators based on common patterns. Improve them for stability:
  • Use data-testid attributes when available
  • Prefer role-based selectors
  • Add fallback locators for reliability

Adding Assertions

Enhance generated tests with additional verifications:
  • Add visual assertions for complex layouts
  • Include URL verification after navigation
  • Add wait steps for dynamic content

Use Cases

Rapid Prototyping

Quickly create test skeletons for new features:
Test the new checkout flow:
- Add product to cart
- Proceed to checkout
- Fill shipping information
- Select payment method
- Complete purchase
- Verify order confirmation

Coverage Expansion

Generate tests for common scenarios:
Test password reset flow:
- Click forgot password link
- Enter email address
- Submit form
- Verify confirmation message
- Check email for reset link

Regression Test Creation

Build regression suites from feature descriptions:
Test user profile editing:
- Navigate to profile settings
- Update display name
- Change email address
- Update avatar image
- Save changes
- Verify all changes are reflected

Best Practices

  1. Start with clear goals: Know what you want to verify before describing
  2. Include specific values: Use actual test data in descriptions
  3. Describe expected outcomes: Tell AI what success looks like
  4. Review all locators: Verify selectors match your application
  5. Add error handling: Include steps for expected error states
  6. Use environment variables: Replace hardcoded URLs and credentials

AI Credit Usage

ActionCredits
Generate test from description1 credit
Credits are consumed when the generation process starts, regardless of outcome.

Limitations

  • Cannot access your live application during generation
  • May not know application-specific selectors
  • Complex conditional logic requires manual setup
  • Multi-tab scenarios need manual configuration

Troubleshooting

Generated Steps Don’t Match App

  • Provide more specific descriptions
  • Include actual selector hints if known
  • Use the recorder to capture accurate locators

Missing Assertions

  • Explicitly state what to verify in your description
  • Add verification phrases like “verify”, “check”, “assert”

Incorrect Navigation

  • Specify full URLs or paths
  • Describe the navigation flow step by step