Skip to main content

Form Validation Tester Recipe

The Form Validation Tester recipe is a specialized recipe that focuses on testing form validation logic and error handling across your application.

Overview

This recipe guides ExploreChimp through your SmartTests with a focus on form interactions, validation rules, and error handling. The agent systematically tests form inputs, validation messages, and error states to ensure forms work correctly and provide appropriate feedback to users.

What This Recipe Does

During explorations using this recipe, ExploreChimp:

  • Detects forms in your SmartTests by analyzing form submission steps
  • Identifies form fields and their semantic types (email, password, date, phone, etc.) using screenshot analysis
  • Tests invalid input classes systematically across all detected forms
  • Verifies validation behavior by checking if forms properly reject invalid input
  • Optimizes journey selection to prioritize high-value bugs and maximize coverage
  • Tags validation bugs at the screen-state level with detailed context

Invalid Input Classes Tested

The Form Validation Tester checks the following invalid input classes:

Required Field Validation

  • Missing Required: Submitting a form without filling required fields
  • Whitespace Only: Filling required fields with only whitespace characters

Format Validation

  • Invalid Email: Invalid email format (e.g., "notanemail")
  • Invalid Phone: Invalid phone number format
  • Invalid URL: Invalid URL format
  • Text in Numeric: Text characters in numeric fields (amount, quantity)
  • Numeric in Text: Numeric-only input in text fields (name, address, search)

Date Validation

  • Invalid Date Format: Incorrectly formatted dates
  • Future Date Not Allowed: Future dates where only past dates are allowed
  • Past Date Not Allowed: Past dates where only future dates are allowed
  • Out of Range Date: Dates outside the allowed range

Length Validation

  • Over Max Length: Input exceeding maximum allowed length
  • Below Min Length: Input below minimum required length

Numeric Value Validation

  • Negative Not Allowed: Negative numbers where only positive values are allowed
  • Zero Not Allowed: Zero values where non-zero is required
  • Decimal Not Allowed: Decimal numbers where only integers are allowed

Security & Special Characters

  • HTML Injection: HTML tags and script injection attempts
  • Unicode Special: Unicode characters, emojis, RTL characters, zero-width characters
  • Newlines/Tabs: Newline and tab characters in single-line fields

Business Logic Validation

  • Duplicate Value: Duplicate values where uniqueness is required
  • Simple Password: Passwords that don't meet complexity requirements (e.g., only lowercase letters)
  • Zero Results Search: Search queries that produce zero results (tests empty state handling)

Journey Optimization

The Form Validation Tester uses intelligent optimization to maximize bug discovery while minimizing redundant testing:

Scoring System

Each validation check is assigned a priority score based on:

  • Base Weight: Inherent importance of the invalid input class (e.g., missing required fields = 100, unicode special = 50)
  • LLM Priority Weight: Field-specific priority determined by analyzing form context
  • Cross-Form Patterns: Checks are deprioritized if the same bug pattern appears across multiple forms
  • Field Type Signals: Checks are deprioritized if the same field type already failed validation on another form
  • Untested Bonuses: Forms and screen-states with no checks yet receive priority boosts

Optimization Strategies

  • Pattern Detection: After testing 2+ forms, the agent identifies cross-form patterns and adjusts priorities accordingly
  • High-Value Focus: Prioritizes checks with higher base weights (missing required, invalid email, etc.)
  • Coverage Maximization: Gives bonuses to untested forms and screen-states to ensure broad coverage
  • Efficient Journey Planning: Selects the highest-scoring uncovered check for each journey, ensuring maximum value per execution

Validation Strategies

The recipe uses different validation strategies based on the invalid input class:

  • Submit Prevented: For missing required and whitespace-only, checks if the submit button is disabled
  • Post-Submit Error: For format and value errors, submits the form and checks for error messages

Configuration

When using the Form Validation Tester recipe, you can configure:

  • SmartTest selection: Choose a specific test or test folder to guide the exploration
  • Max credits: Set the maximum number of explorer credits to consume
  • Max journeys: Set the maximum number of journeys to execute

How It Works

  1. Form Detection: The agent analyzes your SmartTests to identify all forms and their submission points
  2. Field Analysis: For each form, the agent uses screenshot analysis to identify fields, their types, and applicable invalid input classes
  3. Check Planning: The agent creates a prioritized list of validation checks to perform
  4. Journey Execution: For each journey, the agent:
    • Navigates to the target form
    • Fills fields with valid data (happy path)
    • Applies the invalid input for the target check
    • Attempts to submit or checks if submission is prevented
    • Analyzes the result to determine if validation worked correctly
  5. Bug Reporting: Validation failures are reported as bugs with detailed context about the invalid input class and expected behavior
  6. Optimization: After each journey, the agent updates priorities based on results and selects the next highest-value check

When to Use This Recipe

Use the Form Validation Tester recipe when:

  • You have many forms in your application
  • You need to ensure validation logic works correctly across all forms
  • You want to verify error messages are displayed correctly and appropriately
  • You need to test edge cases and boundary conditions systematically
  • You're preparing for a release with form changes
  • You want comprehensive form validation coverage with minimal manual effort

This recipe is particularly useful for applications with complex forms, ensuring that all validation rules are properly enforced and that users receive appropriate feedback for invalid input.