On this page
Address form testing fails in predictable places. The fields are simple, so the form gets built quickly, and then it silently mangles a Canadian postal code, drops a German leading zero, or demands a state after the user picks Hong Kong. A checklist is worth more here than exploratory testing, because the failure set is well known and finite.
This is a 40-point checklist grouped into eight areas, with the concrete rule behind each point. It assumes a form with line 1, line 2, city, region, postal code, and country, which covers the overwhelming majority of checkout and signup flows. Every point can be observed without access to the backend, and every one maps to a defect that has shipped somewhere.
1. Field inventory and constraints
Start by writing down every field, its purpose, its storage limit, and whether it is required. Half of the defects in this checklist are impossible to evaluate without that table, because "the form rejected my address" is not actionable until you know which field rejected it and why.
Constraints should be per country, not global. A single postal max length of 10 works for most countries and breaks for Ireland at 8 characters with a space, and a global city max of 30 truncates plenty of real names. Set generous limits and validate the country pattern rather than a length that was chosen for one market.
| Field | Required when | Suggested max | Validate as |
|---|---|---|---|
| Address line 1 | Always, except pure PO box forms | 100 characters | Free text, non-empty after trim |
| Address line 2 | Never | 100 characters | Free text, optional |
| City | Always | 85 characters | Free text, not only a list |
| Region | Where the country has regions | 3 characters for US and CA | Controlled list per country |
| Postal code | Where the country has one | 12 characters | Country pattern |
| Country | Always | 2-letter code plus name | Fixed list |
2. Country and region dependency
Changing the country must reset the region, relabel the postal field, change the keyboard and the pattern, and clear any stale validation state. The classic bug is a Canadian province left selected after switching to the United States, which submits a valid-looking form with an impossible pair of values.
Hong Kong and the United Arab Emirates have no postal codes, so the field must become optional and the label should say so. Japan reverses the address order, and the form should either present fields in the local order or make clear that the Western order is expected. Test the switch in both directions and test a country switch after a validation error has already been shown.
| Country change | Expected region list | Expected postal behaviour |
|---|---|---|
| US to CA | Provinces and territories | A1A 1A1 pattern, space allowed |
| CA to US | 50 states plus DC and territories | 5 digits or ZIP+4 |
| Any to HK | Districts | Optional, empty allowed |
| Any to UAE | Emirates | Optional, empty allowed |
| US to GB | Counties or free text | Outward and inward code |
| GB to JP | Prefectures | 3-4 digits, hyphen allowed |
3. Validation timing and state
Validate format on blur, validate required fields on submit, and clear an error as soon as the value becomes valid. Validating on every keystroke punishes a user who is halfway through typing a postal code, and validating only on submit means the user discovers six errors at once with no guidance.
Never disable the submit button as a substitute for validation. A disabled button with no explanation is the most common accessibility complaint in address forms, because the user cannot tell what is missing and a screen reader may not announce the change. Keep the button enabled, submit, and show a summary with links to each field.
| Event | What to validate | What to show |
|---|---|---|
| On change | Country and region consistency | Reset dependent fields |
| On blur | Format of the field that lost focus | Inline error if invalid |
| On input after error | Re-check and clear if fixed | Remove the error immediately |
| On submit | All fields, including required | Summary plus focus to first error |
| On server response | Field-level server errors | Map back to the same field ids |
4. Error copy and error placement
An error message must say which field is wrong, what the accepted format is, and how to fix it. "Invalid address" fails all three. "Postal code must be 5 digits, for example 97205" passes. For countries whose format is unusual, include an example rather than a pattern, because users do not read regexes.
Place the error next to the field and also in a summary at the top of the form when the form is long. Associate it with aria-describedby and set aria-invalid on the input. Move focus to the first invalid field on submit, or to the summary if the summary is interactive. Test with a screen reader, not just visually.
- Name the field in the message
- Give the expected format with an example
- State what to do, not just what is wrong
- Never blame the user; say "Enter a 5-digit ZIP"
- Keep the message in the page language and direction
5. Input handling: paste, autofill, and keyboards
Paste is where formatting bugs surface. A user pastes "K1A 0B1" with a non-breaking space, or a full address into line 1. The form should trim, normalize known separators, and preserve internal spaces. It should not strip hyphens from a ZIP+4 or from a Dutch code, and it should not uppercase a city name that is legitimately mixed case.
Autofill depends on the correct token names. Use address-line1, address-line2, address-level2 for city, address-level1 for region, postal-code, and country, and do not reuse street-address on a single-line field unless it really is a multiline street block. On mobile, numeric keyboards usually lack a hyphen, so a ZIP+4 or a Dutch code entered with inputmode="numeric" becomes impossible to complete. Use inputmode="text" where the pattern allows separators.
| Field | Autocomplete token | Mobile keyboard |
|---|---|---|
| Address line 1 | address-line1 | text |
| Address line 2 | address-line2 | text |
| City | address-level2 | text |
| Region | address-level1 | text or a picker |
| Postal code | postal-code | text when a hyphen is allowed |
| Country | country | picker |
6. Length, truncation, and encoding
Test the boundary and one character past it for every field. Truncation is worse than rejection, because the user sees a successful submit and the stored value is wrong. If the database column is 50 characters and the form allows 100, the defect appears only on long inputs, which is exactly what hand-written fixtures never contain.
Test non-ASCII characters: accented letters, the apostrophe in O Connell, the hyphen in a French street name, the sharp s in a German street, and right-to-left scripts. Check that the value round-trips through the API, the database, the CSV export, and the printed label. Encoding bugs often appear only at the export step, which is the step nobody tests.
- Boundary: max minus one, max, max plus one
- Accents: e-acute, u-umlaut, c-cedilla
- Punctuation: apostrophes, hyphens, periods in street abbreviations
- Whitespace: leading, trailing, double, non-breaking
- Scripts: Arabic and Hebrew for direction, Japanese for width
- Round trip: form, API, database, export, label
7. Accessibility and localization
Every field needs a visible label programmatically associated with the input. Placeholder text is not a label: it disappears on input and is inconsistently announced. Group the address fields in a fieldset with a legend, and make the country and region selects operable by keyboard with a type-ahead.
For right-to-left locales, set dir on the container and not on individual inputs, so the punctuation and the error icon stay in the right place. Check that translated labels do not overflow at 200 percent zoom, and that the error summary is announced when it appears. These are cheap checks that catch the defects accessibility audits charge for.
| Check | Pass condition |
|---|---|
| Label association | Clicking the label focuses the input |
| Aria on error | aria-invalid true and aria-describedby points to the message |
| Focus order | Tab order follows the visual order |
| Zoom | Layout works at 200 percent with no overlap |
| RTL | Direction set on the container, icons mirrored |
| Screen reader | Field name, value, and error all announced |
8. The regression pack
Turn the checklist into a small automated pack that runs on every change. Twenty cases cover the failure set: one valid and one invalid case for the primary market, one case each for Canada, the UK, Germany, Japan, Brazil, Hong Kong, and the UAE, plus boundary lengths, a non-ASCII city, a pasted value with a non-breaking space, and a country switch after an error.
Keep each case independent and seeded. Assert on the shape of the result rather than a literal string, and assert on the visible error text for the invalid cases, because error copy regressions are real regressions. A pack this size runs in seconds and catches the majority of the defects described above.
| Case group | Count | Covers |
|---|---|---|
| Primary market valid and invalid | 4 | Core paths and error copy |
| Structural outliers | 7 | CA, GB, DE, JP, BR, HK, AE |
| Boundary lengths | 4 | Truncation and rejection |
| Encoding and paste | 3 | Non-ASCII, NBSP, full-address paste |
| Dependency resets | 2 | Country switch, refresh with stale values |
Questions
- About twenty cover the common failure set: primary-market valid and invalid cases, structural outliers such as Canada, Japan, and Hong Kong, boundary lengths, encoding, and country-switch resets.
- No. Validate format on blur and required fields on submit, then clear errors as soon as the value becomes valid. Keystroke validation punishes users who are mid-entry.
- Hong Kong has no postal codes, so a required postal field blocks a valid address. The same applies to the United Arab Emirates; both should make the field optional.
- address-line1, address-line2, address-level2 for city, address-level1 for region, postal-code, and country. They let browsers fill the form correctly.
- Submit a value at the maximum length, one character under, and one character over, then read the stored value back. Silent truncation after a successful submit is the defect to catch.
How many test cases does an address form need?+
Should validation run on every keystroke?+
Why does Hong Kong break address forms?+
What autocomplete tokens should an address form use?+
How do I test truncation?+
Examples are synthetic. Do not use a generated address for identity checks, account registration, or delivery.