How to Test Forms and User Inputs
Rihario automatically tests forms during exploration. The AI identifies form fields, fills them with appropriate test data, validates inputs, submits forms, and reports any issues. Works for contact forms, search forms, checkout forms, and more.
How Form Testing Works
When the AI encounters any form, it:
- Identifies the form - Recognizes form elements on the page
- Analyzes fields - Determines field types (email, text, select, checkbox, etc.)
- Generates test data - Creates appropriate test values for each field type
- Tests validation - Checks required fields, formats, and rules
- Fills the form - Types or selects values for each field
- Submits the form - Clicks submit and observes the result
- Reports issues - Flags validation problems, submission errors, or UX issues
Types of Forms Tested
Contact Forms
- Name, email, message fields
- Validation of required fields
- Email format checking
- Submission and confirmation
Search Forms
- Search input fields
- Search button functionality
- Search results display
- Empty query handling
Checkout Forms
- Shipping address fields
- Payment information
- Credit card validation
- Order summary
Multi-Step Forms
- Wizard-style forms
- Step navigation
- Progress indicators
- Data persistence between steps
What Gets Tested
Field Validation
- Required fields - Error when empty
- Email format - Valid email addresses
- Phone format - Valid phone numbers
- Number ranges - Min/max values
- Password strength - Password requirements
- Custom validation - Business rule validation
Form Submission
- Submit button works - Form actually submits
- Loading states - Loading indicators during submission
- Success handling - Success messages or redirects
- Error handling - Error messages displayed correctly
- Prevent double submission - Can't submit multiple times
User Experience
- Field labels - Labels are visible and associated
- Placeholder text - Helpful placeholder values
- Error visibility - Error messages are visible
- Form layout - Fields aren't overlapping or broken
- Accessibility - Keyboard navigation works
How to Test Forms
Automatic Testing
Forms are tested automatically during exploration. Just start an exploration and the AI will test any forms it encounters.
Focused Form Testing
To focus on form testing, add instructions:
Example Instructions:
- "test the contact form"
- "check form validation"
- "test checkout form fields"
- "verify search form works"
Understanding Form Test Results
Common issues found when testing forms:
❌ Validation Issue
Form submits with empty required fields. No error messages displayed.
❌ Submission Error
Form submission failed. Console error: "Cannot read property 'value' of null"
⚠️ UX Issue
Error messages overlap with form fields, making them hard to read.
Field Type Handling
The AI handles different field types:
- Text inputs - Generates realistic text data
- Email fields - Creates valid email addresses
- Password fields - Generates test passwords
- Number fields - Uses appropriate numeric values
- Select dropdowns - Selects from available options
- Checkboxes - Checks/unchecks as appropriate
- Radio buttons - Selects one option
- Date pickers - Selects valid dates
- File uploads - May skip or use test files (varies)
Validation Testing
The AI tests validation by:
- Trying to submit with empty required fields
- Testing invalid formats (wrong email, etc.)
- Verifying error messages appear
- Checking that invalid forms don't submit
- Ensuring valid forms do submit
Limitations
- File uploads - May not test file upload functionality thoroughly
- Complex validation - May miss business logic validation rules
- CAPTCHA - Cannot solve CAPTCHAs (blocks exploration)
- Not exhaustive - Tests common cases, not every possible input
- Custom components - May not handle custom form components perfectly
Best Practices
- Test on staging - Use test data, avoid production submissions
- Focus instructions - Add "test form validation" to guide the AI
- Verify findings - Manually check if reported issues are real
- Test edge cases manually - AI tests common cases, you test unusual ones
- Check accessibility - Ensure forms work with keyboard navigation