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:

  1. Navigate to form page

  2. Fill all required fields

  3. Submit form

  4. Verify success message or redirect

Step 2: Record the Test

  1. Open browser plugin

  2. Navigate to form page

  3. Click "Record"

  4. Fill form:

    • Click on first field

    • Type value

    • Tab to next field (or click)

    • Type value

    • Continue for all fields

    • Click submit button

  5. Wait for confirmation:

    • Success message appears

    • Or page redirects

    • Or confirmation element appears

  6. Click "Stop and Save"

  7. Enter test name: Contact Form Submission Test

  8. Click "Save"

Step 3: Review Generated Steps

  1. Go to test detail page

  2. Review FILL steps:

    • Verify selectors for each field

    • Check values are correct

    • Ensure all fields are filled

  3. Review CLICK step:

    • Verify submit button selector

    • Check button is correct

  4. 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

  1. Click "Run Test"

  2. Monitor execution:

    • Watch form filling

    • Check submission

    • Verify confirmation

  3. Wait for completion

Step 6: Verify Results

  1. Check execution status

  2. Review step results:

    • All FILL steps should succeed

    • CLICK step should succeed

    • WAIT step should succeed

  3. 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:

  1. Record each step separately

  2. Or record complete flow

  3. Add waits between steps

  4. Verify progress indicators

Dynamic Forms

For forms with dynamic fields:

  1. Use stable selectors

  2. Wait for fields to appear

  3. Handle conditional fields

  4. Test different scenarios

File Uploads

For forms with file uploads:

  1. Record file selection

  2. Verify file is selected

  3. Submit form

  4. Verify upload success

Troubleshooting

Fields Not Filling

Problem: FILL steps fail

Solution:

  1. Check selectors for fields

  2. Verify fields are visible

  3. Add waits before filling

  4. Check for disabled fields

Submit Button Not Clicking

Problem: CLICK step fails

Solution:

  1. Check submit button selector

  2. Verify button is enabled

  3. Wait for form validation to complete

  4. Scroll to button if needed

Confirmation Not Appearing

Problem: WAIT step times out

Solution:

  1. Check confirmation element selector

  2. Verify element actually appears

  3. Increase timeout if needed

  4. Check for different confirmation types

Best Practices

  1. Fill All Fields: Ensure all required fields are filled

  2. Verify Values: Check that values are correct

  3. Wait for Confirmation: Always wait for success message

  4. Test Validation: Test both valid and invalid inputs


← Back to Documentation

Last updated