Sub topic 14
Testing the Flow and Measuring Drop-Off
Assume you know basic HTML form controls, JavaScript or TypeScript, and how a browser submits form data. This chapter focuses on verifying a multi-step flow and using event data to find where users stop.
Test the flow as a user journey
A multi-step form can pass individual field tests and still fail as a complete journey. Test the transitions between steps, because that is where state, validation, and navigation interact.
Create a test matrix for the important paths:
| Area | Test case | Expected result |
|---|---|---|
| Validation | Continue with an empty required field | The user stays on the step and sees an actionable error |
| Navigation | Enter values, go back, then go forward | Values remain available |
| Conditional logic | Select a choice that hides a field | The hidden field is not validated or submitted |
| Recovery | Refresh after saving a draft | The saved step and values return |
| Submission | Retry after a server error | The data remains and duplicate submission is prevented |
| Accessibility | Navigate with keyboard and screen reader | Focus and step changes are announced clearly |
Include successful paths, invalid input, slow responses, network failures, browser back navigation, refreshes, and repeated clicks on the submit button. Test at narrow viewport sizes as well as desktop sizes.
Test state and transitions
Treat each step as a state transition rather than only a screen. For example, account -> details should be possible only when account validation succeeds. A back action should change the step without deleting values.
Unit tests can exercise the reducer or state machine without rendering a browser. Integration tests should then verify that the rendered controls, error messages, focus behavior, and submitted payload match that state.
A useful end-to-end test starts with a blank form and records each action:
- Open the form.
- Complete the first step with valid data.
- Move to the next step.
- Enter an invalid value.
- Confirm the error appears and focus moves appropriately.
- Correct the value.
- Go back and forward.
- Review the final data.
- Submit once and confirm the success state.
type Step = "account" | "details" | "review";
type FlowEvent = {
name: "step_viewed" | "step_completed" | "validation_failed" | "submitted";
step: Step;
};
const events: FlowEvent[] = [
{ name: "step_viewed", step: "account" },
{ name: "step_completed", step: "account" },
{ name: "step_viewed", step: "details" },
{ name: "validation_failed", step: "details" },
{ name: "step_completed", step: "details" },
{ name: "step_viewed", step: "review" },
{ name: "submitted", step: "review" },
];
function count(events: FlowEvent[], name: FlowEvent["name"], step: Step): number {
return events.filter((event) => event.name === name && event.step === step).length;
}
for (const step of ["account", "details", "review"] as Step[]) {
const viewed = count(events, "step_viewed", step);
const completed = count(events, "step_completed", step);
const rate = viewed === 0 ? 0 : completed / viewed;
console.log(`${step}: ${(rate * 100).toFixed(0)}% completed`);
}Instrument meaningful events
Record events at stable points in the flow, such as when a step becomes visible, when it passes validation, when a user submits, and when submission succeeds or fails. Include a flow version so a redesign does not mix incompatible data.
Avoid recording field values, email addresses, names, or other sensitive content. Use an anonymous session identifier where appropriate, and document the retention period.
Useful measures include:
- Step completion rate: completed steps divided by viewed steps.
- Validation error rate: visits that produce an error divided by step visits.
- Time on step: time between the step view and the next meaningful event.
- Overall completion rate: successful submissions divided by started flows.
- Retry rate: submission attempts after a failure.
- Resume rate: saved drafts that later reach submission.
Interpret drop-off carefully
A low completion rate does not identify the cause by itself. Compare analytics with session replays, support reports, usability tests, and automated test results. A high error rate suggests unclear requirements or validation. A long time on one step may indicate confusion, difficult data entry, or a slow service.
Segment results by device, browser, traffic source, and flow version. Check sample size before acting on a small difference.
Exercise
A step has 1,000 views, 700 successful completions, and 280 validation failures. What should you investigate first?
Show answer
Investigate the validation rules and the field instructions. The 28% validation-failure rate is a stronger direct signal than the remaining 30% of users who did not complete the step, although both groups deserve analysis.