Form Submission
This tutorial shows you how to test form submissions in TrueAssert.
Overview
This tutorial covers:
Recording form interactions
Filling form fields
Submitting forms
Verifying submission results
Prerequisites
TrueAssert account
Browser plugin installed
Website with forms to test
Step 1: Plan Your Test
Test Flow:
Navigate to form page
Fill all required fields
Submit form
Verify success message or redirect
Step 2: Record the Test
Open browser plugin
Navigate to form page
Click "Record"
Fill form:
Click on first field
Type value
Tab to next field (or click)
Type value
Continue for all fields
Click submit button
Wait for confirmation:
Success message appears
Or page redirects
Or confirmation element appears
Click "Stop and Save"
Enter test name:
Contact Form Submission TestClick "Save"
Step 3: Review Generated Steps
Go to test detail page
Review FILL steps:
Verify selectors for each field
Check values are correct
Ensure all fields are filled
Review CLICK step:
Verify submit button selector
Check button is correct
Review WAIT step:
Verify confirmation element selector
Ensure it waits for correct element
Step 4: Optimize the Test
Add Waits
Add waits if needed:
Wait for form to load
Wait for fields to be enabled
Wait for confirmation after submit
Handle Validation
If form has validation:
Test with invalid data
Verify error messages
Test with valid data
Multiple Fields
For forms with many fields:
Verify all fields are captured
Check field order is correct
Ensure no fields are missed
Step 5: Execute Test
Click "Run Test"
Monitor execution:
Watch form filling
Check submission
Verify confirmation
Wait for completion
Step 6: Verify Results
Check execution status
Review step results:
All FILL steps should succeed
CLICK step should succeed
WAIT step should succeed
View screenshots:
Check form filling
Verify submission
Confirm success message
Common Form Types
Contact Forms
Fields: Name, Email, Message Validation: Email format, required fields Confirmation: Success message or email sent
Registration Forms
Fields: Username, Email, Password, Confirm Password Validation: Password strength, email format, uniqueness Confirmation: Account created, redirect to login
Search Forms
Fields: Search query Validation: Minimum length, special characters Confirmation: Results page, results displayed
Advanced Scenarios
Multi-Step Forms
For multi-step forms:
Record each step separately
Or record complete flow
Add waits between steps
Verify progress indicators
Dynamic Forms
For forms with dynamic fields:
Use stable selectors
Wait for fields to appear
Handle conditional fields
Test different scenarios
File Uploads
For forms with file uploads:
Record file selection
Verify file is selected
Submit form
Verify upload success
Troubleshooting
Fields Not Filling
Problem: FILL steps fail
Solution:
Check selectors for fields
Verify fields are visible
Add waits before filling
Check for disabled fields
Submit Button Not Clicking
Problem: CLICK step fails
Solution:
Check submit button selector
Verify button is enabled
Wait for form validation to complete
Scroll to button if needed
Confirmation Not Appearing
Problem: WAIT step times out
Solution:
Check confirmation element selector
Verify element actually appears
Increase timeout if needed
Check for different confirmation types
Best Practices
Fill All Fields: Ensure all required fields are filled
Verify Values: Check that values are correct
Wait for Confirmation: Always wait for success message
Test Validation: Test both valid and invalid inputs
Related Topics
Browser Plugin Recording - Recording guide
Running Tests - Execute tests
Debugging Failed Tests - Fix issues
Last updated