Skip to main content

Overview

The most effective test automation combines the speed of AI with the precision of manual control. This hybrid approach leverages each method’s strengths while compensating for their weaknesses.

Why Hybrid?

ApproachStrengthWeakness
AI OnlyFast, comprehensiveMay miss nuances, locators might be unstable
Manual OnlyPrecise, reliableSlow, time-consuming
HybridFast AND preciseRequires knowing when to use which

The Hybrid Workflow

Phase 1: AI Generation

Start by letting AI do the heavy lifting:
  1. Describe your test goal to the Test Planner Agent
  2. Review the generated plan - don’t accept blindly
  3. Identify what needs refinement - locators, assertions, timing

Phase 2: Manual Refinement

Apply precision where it matters:
  1. Fix locators with Element Picker
    • Replace generic selectors with stable ones
    • Add data-testid attributes where possible
  2. Strengthen assertions
    • AI might add basic verifications
    • Add specific checks for your business logic
  3. Handle edge cases
    • Add waits for dynamic content
    • Configure timeouts appropriately

Phase 3: Record Missing Pieces

Use the Recorder for tricky interactions:
  1. Complex UI components - date pickers, dropdowns, drag-and-drop
  2. Multi-step flows - where clicking through is faster than describing
  3. Capturing exact user behavior - mimicking real user patterns

Phase 4: AI Assistance

Come back to AI for improvements:
  1. AI Chat to add assertions you might have missed
  2. Suggestions for edge cases
  3. Refinement of step descriptions

Practical Examples

Example 1: E-commerce Checkout

Step 1: AI Generation
─────────────────────
Prompt: "Create checkout test with valid payment,
        invalid card, and expired card scenarios"

AI generates 3 tests with basic structure

Step 2: Manual Refinement
─────────────────────────
- Fix product selector: .product-card → [data-testid="product-1"]
- Add precise total verification
- Configure payment form waits

Step 3: Record Payment Flow
───────────────────────────
- Record the 3D Secure popup handling
- Capture exact payment form interactions

Step 4: AI Enhancement
──────────────────────
Ask AI Chat: "Add verification for order confirmation
             email reference number"

Example 2: User Registration

Step 1: Record the Flow
───────────────────────
- Record complete registration
- Captures form fields, validation, success

Step 2: AI Enhancement
──────────────────────
Ask AI: "Generate edge cases for this registration test"

AI suggests:
- Invalid email format
- Password too short
- Duplicate email error
- Missing required fields

Step 3: Manual Precision
────────────────────────
- Fix validation message selectors
- Add specific error text assertions
- Configure unique email with {{ random.email() }}

Example 3: Search Functionality

Step 1: Manual Setup
────────────────────
- Create test structure
- Add navigation to search page
- Configure environment variables

Step 2: AI Chat
───────────────
"Add steps to test search with:
 - Valid query returning results
 - Query with no results
 - Special characters in query"

Step 3: Refine Manually
───────────────────────
- Use Element Picker for result items
- Add count verification
- Configure wait for search results

When to Use Each Method

Use AI When

ScenarioAI Method
Starting from scratchTest Planner Agent
Need comprehensive coverageTest Planner Agent
Adding multiple scenariosAI Chat
Stuck on what to testAI Chat for suggestions
Describing expected behaviorAI Chat

Use Manual When

ScenarioManual Method
Locator is criticalElement Picker
Complex assertion logicEditor
Timing-sensitive stepsEditor with waits
Debugging failuresEditor step-by-step
Business-critical verificationManual assertions

Use Recorder When

ScenarioWhy Recorder
Complex UI interactionsCaptures exact behavior
Long user flowsFaster than describing
Learning the applicationSee what happens
PrototypingQuick baseline

Tips for Success

1. Don’t Trust AI Blindly

AI is smart but doesn’t know your application. Always:
  • Review generated locators
  • Verify assertions match your expectations
  • Test the generated steps

2. Let AI Do Repetitive Work

Don’t waste time on boilerplate:
  • Navigation sequences
  • Form filling patterns
  • Basic verification structures

3. Keep Manual Control Over Critical Paths

For business-critical tests:
  • Choose locators manually
  • Write assertions explicitly
  • Test thoroughly

4. Iterate Quickly

The hybrid approach enables rapid iteration:
Generate → Test → Refine → Test → Enhance → Test

5. Document Your Decisions

When you override AI suggestions:
  • Note why in the test description
  • Help teammates understand the choice
  • Guide future AI interactions

Element Picker in Hybrid Workflow

The Element Picker bridges AI and manual work:

After AI Generation

  1. Run the AI-generated test
  2. Find steps with unstable locators
  3. Use Element Picker to fix them
  4. Verify the fixed steps work

During Recording

  1. Record captures basic locators
  2. Pause recording
  3. Use Element Picker for critical elements
  4. Resume recording

Locator Priority

When fixing locators, prefer:
  1. [data-testid="..."] - Most stable
  2. [role="..."][name="..."] - Semantic and stable
  3. Unique CSS classes - If stable in your app
  4. Text content - Only if text won’t change

Common Patterns

Pattern: AI Structure, Manual Polish

1. AI generates test skeleton
2. Manual: Fix all locators
3. Manual: Add precise assertions
4. AI: Suggest additional checks
5. Manual: Final review

Pattern: Record, Enhance, Verify

1. Record the user flow
2. AI: "Improve this test with better assertions"
3. Manual: Review and fix suggestions
4. Run and verify

Pattern: Manual Critical, AI Peripheral

1. Manual: Build the critical path test
2. AI: "Generate variations of this test"
3. Manual: Review and adjust variations
4. Run all variations

Troubleshooting Hybrid Workflows

AI Suggestions Don’t Fit

  • Provide more context in your prompts
  • Reference specific elements by name
  • Describe your application structure

Recorder Misses Steps

  • Slow down your interactions
  • Add missing steps manually
  • Use AI Chat to fill gaps

Locators Keep Breaking

  • Always verify with Element Picker
  • Add stable test IDs to your application
  • Use multiple fallback locators

Next Steps