Form testing: what to check in a web form

Form testing for websites and web apps: validation, required fields, error messages, labels, autofill, keyboard, mobile input, submission and spam checks.

Upright clear glass panel on a short foot, with three horizontal slots, an orange middle rim and a small clear block below.

Form testing is the check that a web form accepts what it should, refuses what it should not, tells people why, and delivers the result. The pages that rank for it are mostly form builders’ checklists and form-monitoring tools. This guide covers every part of a website or web app form, with sources, and a checklist table to copy.

What form testing covers

Forms are where a visitor gives a site something: a lead, an order, a sign-up, a support request. When one breaks, the page usually still looks fine, which is why form faults reach production. The monitoring service FormTester 365 lists the usual causes as an update that conflicts with other code, new validation rules that reject valid answers, and a conditional step that no longer opens.

The word has two meanings in search results. Marketing teams use form testing for A/B tests of form design, measured in completions. Quality assurance uses it for checking that the form works. This guide is about the second, and the first depends on it: a variant that loses submissions has no conversion rate worth comparing.

A complete pass covers nine areas, in roughly the order a tester meets them:

  1. Required fields
  2. Validation of each field
  3. Error messages
  4. Labels and instructions
  5. Autofill
  6. Keyboard use
  7. Mobile input
  8. Submission and confirmation
  9. Spam protection and analytics

Write the rules down before you start: which fields are required, the limits of each, the accepted formats, what happens on success and where the data goes. Without them a tester can only report what the form did, never whether that was right. A test case template holds each rule as a case with its expected result, and the web application testing guide places forms among the other layers of a release.

Required fields and validation, on the page and on the server

Start with the required fields, because every other check depends on them. The Thinking Tester blog sets out a methodical order: submit the form empty and check every required field shows an error, then fill one required field at a time, then all but one, cycling until each missing field has been tried on its own. Finish with all required fields filled and the optional ones empty, and confirm the record saved correctly.

Then test each field at its limits. For a field with a minimum and a maximum length, try one character, the minimum minus one, the maximum plus one and far beyond the maximum, then the exact minimum and maximum. This is boundary value analysis, and grouping inputs into valid and invalid classes first (equivalence partitioning) keeps the number of cases sensible. Names need apostrophes and hyphens (O’Connor, Smith-Clark); postcodes, phone numbers and dates need every format the form says it accepts.

The W3C’s forms tutorial on validation asks validation to be as accommodating as possible, for example accepting telephone numbers written with different separators and groupings. So a good validation test also checks that reasonable input is accepted: a phone number with spaces, an email address with a plus sign, a postcode in lower case.

Finally, repeat the invalid cases with the browser’s checks out of the way. The same W3C tutorial states that client-side validation alone does not ensure security and that data needs to be validated on the server as well. Remove the required or maxlength attribute in the browser’s developer tools (the inspect element guide shows how) and submit: the server should refuse the input and say so, without a stack trace or a database error on the page.

Error messages and labels a screen reader can use

A form that rejects bad input but does not say why is half tested. WCAG 2.2 Success Criterion 3.3.1, Error Identification, requires that when an input error is detected automatically, the item in error is identified and the error is described to the user in text. Re-displaying the form with a red border is not enough.

The W3C tutorial on user notifications gives the pattern to test against. A list of errors at the top of the form should have a distinctive heading, and each item should reference the label of its field, describe the error, say how to correct it and link to the field. Each field can be tied to its own message with aria-describedby, and focus can move to the first field in error. Test success too: the same tutorial says success messages matter for confirming the task is complete.

Native browser validation needs its own check. The Understanding document for 3.3.1 points out its weaknesses: depending on the browser, the message may not persist or scroll with the page, it does not grow when the user zooms, it is generic, and only the first error is shown, so a form with three mistakes takes three submissions to correct.

Labels come next. The W3C labels tutorial asks for a label element whose for attribute exactly matches the field’s id, and warns that the title attribute is less reliable because some screen readers do not treat it as a label. Google’s sign-in form guidance adds that placeholders should not stand in for labels, because people forget what the field was for once they start typing. Three quick tests cover most of it:

  • Click each label: focus should move to its field.
  • Mark required fields in text as well as with an asterisk or colour. The W3C tutorial’s example writes “(required)” in the label.
  • Listen to the form with a screen reader. The screen reader testing guide covers the commands; each field should announce its label, its state and its error.

Tools catch the mechanical part. Google’s form testing module notes that Lighthouse warns when a label is not connected to its control, the Form troubleshooter extension flags missing autocomplete attributes and empty labels, and accessibility checkers such as WAVE or axe report missing label connections. A message such as “Invalid input” passes every one of those tools and still helps nobody, so a person reads each error.

Autofill, keyboard and mobile input

Autofill saves typing for everyone and is essential for some users. WCAG Success Criterion 1.3.5, Identify Input Purpose, asks that fields collecting information about the user expose their purpose in code, which in HTML means the autocomplete attribute with values such as name, email or postal-code. Test by filling the form from the browser’s saved details: every field should take the right value, and none should take the wrong one (a company name in the person’s name field is a common miss). MDN’s autocomplete reference also records that autocomplete="off" does not stop most browsers’ password managers from filling a login form, so do not treat it as a security control.

For keyboard use, put the mouse away, as Google’s form testing module suggests, and complete the form with Tab, Shift+Tab, Space, Enter and the arrow keys. Check that the focus order follows the visual order, that the focus ring is visible on every control, that custom dropdowns and date pickers open and close from the keyboard, and that Enter in a text field submits the form. The keyboard navigation entry lists what each key should do.

Mobile input needs a real phone. The input type decides which keyboard appears: email brings up a keyboard with the @ sign and tel a telephone keypad, according to Google’s sign-in guidance, which also warns against type="number" for IDs and account numbers because it adds up and down arrows meant for quantities. The inputmode attribute chooses a keyboard without changing the type, and MDN’s inputmode reference notes that it enforces no validity rules, so validation still has to be tested separately. On the phone, also check that the on-screen keyboard does not cover the submit button, that the page does not zoom in on focus, and that a half-filled form survives a rotation. The widths worth trying are in the common screen resolutions data.

Long, multi-step forms have one more rule. WCAG Success Criterion 3.3.7, Redundant Entry, says information the user already entered in the same process should be filled in or offered for selection, for example with a “billing address is the same as delivery address” checkbox. Test that going back a step keeps the answers.

Submission, confirmation, spam protection and analytics

The submission is where most of the value is lost, and the browser cannot tell you it worked. FormTester 365 is candid about this in its own FAQ: a test that checks browser submission success, such as a thank-you page, does not confirm delivery to an inbox or CRM. So test the whole path:

  • Submit once. Double-click the button and press Enter twice. Google’s sign-in guidance recommends disabling the button after the first click, because many users click more than once, and also warns against disabling it while fields are still empty, which leaves people tapping a dead button with no explanation.
  • Confirm the result. The page should say clearly that the submission worked and what happens next. A form that clears itself without a message looks like a failure.
  • Check the destination. Find the entry in the database, the CRM, the inbox or the helpdesk, with every field in the right place and characters such as é or ø intact. Check the autoresponder, if there is one, reaches the visitor.
  • Break the network. Submit on a throttled or dropped connection and check the form keeps the data and explains what to do.
  • Check the button text. Google recommends a label that says what the button does, such as Create account, over Submit.

Spam protection should block bots without blocking people. Submit through the form’s real path from a keyboard and a screen reader and confirm a person can pass the challenge. When the challenge sits in a sign-in flow, WCAG Success Criterion 3.3.8, Accessible Authentication, requires a path that does not depend on a puzzle, unless the test is recognising objects or content the user provided. If the form uses a hidden honeypot field, confirm autofill does not fill it, or real visitors will be discarded as spam.

Analytics is the last check and the most often skipped. Google’s guidance asks sign-in and sign-up flows to carry page analytics, interaction analytics such as funnels and events, and performance measurement. For testing, that means one thing: the success event fires once, after a confirmed submission, and never on a failed one or on the click alone. A conversion counted on click turns every validation error into a sale.

The form testing checklist

Copy the table into a sheet or a QA checklist, one row per field where the check is per field.

AreaCheckPass when
Required fieldsSubmit emptyEvery required field shows its own error and nothing is saved
Required fieldsSubmit with one required field missing, for each fieldThe missing field is named, the others keep their values
Required fieldsSubmit with only required fields filledThe record saves and optional fields are stored empty
ValidationEach field at minimum, maximum, one below and one aboveLimits accepted, out-of-range values refused with a message
ValidationReasonable variants (spaces in phone numbers, plus sign in email, lower-case postcode)Accepted or normalised without an error
ValidationInvalid input with browser checks removed in DevToolsThe server refuses it and shows a message, no stack trace
ValidationScript and SQL fragments in text fieldsStored and shown as plain text, never run
Error messagesRead each errorNames the field, says what is wrong and how to fix it
Error messagesSubmit with three errorsAll three shown at once, focus moves to the first
LabelsClick each labelFocus moves to its field
LabelsScreen reader on each fieldLabel, required state and error are announced
LabelsRequired fieldsMarked in text, as well as by symbol or colour
AutofillFill from saved browser detailsEach field takes the right value, none takes a wrong one
KeyboardComplete and submit without a mouseLogical order, visible focus, every control usable
MobileEmail, phone and number fields on a phoneThe matching keyboard appears, the submit button stays visible
MobileRotate the phone mid-formValues kept, layout intact
Multi-stepGo back a stepEarlier answers are still there
SubmissionDouble-click the submit buttonOne record, one email
SubmissionSubmit on a dropped connectionData kept, a clear message, a way to retry
ConfirmationAfter successA visible success message that says what happens next
DestinationInbox, CRM or databaseThe entry arrives complete, with special characters intact
Spam protectionReal user from keyboard and screen readerCan pass the challenge, honeypot left empty by autofill
AnalyticsFailed and successful submissionsSuccess event fires once, only on confirmed success

When a row fails, the report decides how fast it is fixed. Name the field and the test data you typed, quote the message the form showed, and add a screenshot with the field marked. For a failed submission, the developer needs the request and its status code and any console error, and never a full network export, which carries the posted form data with it; the post on HAR file security explains why. Notarus evidence capture attaches the screenshot, console errors and network calls to the report, records each call as its result without the payload, and strips passwords and tokens from captured logs, so a form bug arrives with what the developer needs and without what the visitor typed.

Common questions

What is form testing?

Form testing is the checking of a web form before and after release: that it accepts valid input, rejects invalid input with a clear message, can be completed by keyboard, screen reader and phone, submits once, confirms the result and delivers the data where it is meant to go. Marketing teams also use the term for A/B tests of form design.

What should you test in a web form?

Test nine areas: required fields, validation of each field at its limits, error messages, labels and instructions, autofill, keyboard use, mobile input types, the submission and its confirmation, and the spam protection and analytics around the form. A form passes when the data arrives at its destination, which the browser alone cannot confirm.

How do you test form validation?

Submit the form empty, then with each required field missing in turn, then with every field at and beyond its limits. Repeat the invalid cases with browser validation bypassed, because the W3C forms tutorial notes that client-side validation alone does not ensure security, so the server has to enforce the same rules.

How do you test a form for accessibility?

Complete the whole form with the keyboard alone, then with a screen reader, and check that every field announces a label, that required fields are marked in text, and that each error names its field and says how to fix it. Automated checkers such as Lighthouse, WAVE or axe find missing labels, but only a person can judge whether a message helps.

Can form testing be automated?

Much of it can. Scripted browser tests repeat the submission paths and validation rules on every build, and monitoring services fill and submit a live form on a schedule. Keyboard use, screen reader output, wording of messages and the experience on a real phone still need a person, so most teams combine both.

What is the difference between form testing and A/B form testing?

Form testing in QA asks whether a form works for everyone who uses it. A/B form testing shows two versions of a working form to different visitors and measures which one more people complete. Run the QA checks first, because a variant that fails validation or loses submissions makes any conversion result meaningless.

The Notarus team

The people who build Notarus. We write up the decisions behind the product when the reasoning is worth more than the changelog line.

Keep reading

Reports with the evidence attached.

Start free, one script tag.

<script src="…/widget.js" data-key="pb_pub_…">