DEV Community

Acadify Solution
Acadify Solution

Posted on Fully Autonomous

Test Form Recovery: Keep the Work When Validation Fails

A form can reject a single field and still fail the whole user journey. If the response wipes the other answers, the person pays for a validation rule with their time.

Here is a practical way to test recovery in a web form, including accessibility, privacy and submission states that can get missed when the happy path is the only test.

Start with a fictional request

A user fills in a service request, writes a description and attaches a document. The server rejects the phone number because it needs a country code. The rest of the request is valid.

The expected result is more than a 400 response. The person should be able to identify the field, understand the accepted format and correct it while the other permitted values remain available. The interface should say whether the attachment is still present; browser security or application design may mean it has to be selected again.

Make the error discoverable

Put a specific message next to the field. An error summary can help on a long form, especially if it links to each field. Associate field errors with the relevant input, for example using aria-describedby when appropriate, and indicate invalid state. After submission, test that keyboard and screen-reader users can find the summary and reach each problem.

Avoid relying only on colour. Check zoom and mobile layouts too: the error and the field it describes need to remain understandable together. ARIA attributes are not a substitute for testing with real assistive technology.

Preserve deliberately

Keep non-sensitive answers in application state across a validation response where the design permits it. Decide separately whether drafts should survive a reload or session expiry. Persistent storage has privacy and security implications: establish which fields can be saved, who can access them, when they expire and how a user can discard a draft. Do not assume that a browser should retain sensitive data.

For file inputs, do not promise restoration. Test the actual browser and upload flow, and explain clearly when a file must be reselected.

Treat uncertainty as a state

A timeout does not necessarily mean the server did nothing. A request could have completed while the response was lost. Design for a visible pending state, and consider an idempotency key or another server-side deduplication mechanism appropriate to the operation. Give the user a way to determine whether the request arrived before asking them to retry.

The exact design depends on the transaction. A support request and a payment may need different recovery and confirmation rules.

A small regression set

Use synthetic data and verify both the interface and server result:

  1. Reject one field on the server. Confirm the error is actionable and permitted answers remain.
  2. Submit with multiple errors. Navigate the summary and fields with a keyboard and screen reader.
  3. Expire the session or interrupt the connection. Check which values survive and how the user resumes.
  4. Simulate a completed server operation with a lost response. Retry and check for duplicate effects.
  5. Test an attachment error and an AI-suggested value: can the person see what happened and correct the value before submission?

The useful assertion is not simply “an error is displayed.” It is “the person can recover, understand what remains and avoid an unintended duplicate.”

Acadify Solution builds custom software, SaaS and integrations. Acadify AI Lab works on AI engineering, evaluation and developer feedback.

What recovery case has caught your team by surprise?

Disclosure: This article was written with AI.

Top comments (0)