Keyboard testing
The highest-value accessibility test there is. It needs no software, takes five minutes a page, and catches failures that affect blind users, users with motor disabilities, switch users, and everyone driving the page by voice — because voice control and switch devices operate the keyboard interface underneath.
Before you start
Physically move the mouse out of reach. Every accessibility professional has caught themselves nudging the pointer out of habit, and it invalidates the test.
On macOS, first turn on System Settings → Keyboard → Keyboard navigation. Without it, Safari and Chrome will not Tab to links and buttons, and you will report failures that are really a system setting.
The keys
| Key | Expected behaviour |
|---|---|
| Tab | Move to the next focusable control, in reading order |
| Shift+Tab | Move backwards. Must work everywhere Tab does |
| Enter | Activate a link or a button; submit a form from a text field |
| Space | Activate a button, toggle a checkbox, open a select. Never scrolls while a control has focus |
| Arrow keys | Move within a composite widget: radio group, tab list, menu, slider, select |
| Escape | Close a dialog, menu, or popover, returning focus to whatever opened it |
| Home / End | Jump to the first or last item in a widget or a slider's range |
The test script
- Press Tab once from the top of the page. A skip link should appear and be visible. Activate it and press Tab again — focus must now be inside the main content, not back at navigation item two. 2.4.1
- Tab through every control on the page. Say out loud where focus is at each stop. If you cannot tell, that is a failure. 2.4.7
- Compare the focus order with the visual order. It should move left to right, top to bottom, and never jump unexpectedly. 2.4.3
- Check that you can reach everything you could click. Anything operable with a mouse but not the keyboard fails outright. 2.1.1
- Open every dialog, menu and popover. Focus must move into it; Escape must close it; focus must return to the trigger. 2.1.2 2.4.3
- Try to get stuck. Tab into custom widgets, embedded players and third-party iframes, then try to leave in both directions. 2.1.2
- Watch for focus disappearing under sticky headers or cookie banners. Do this at 100% and again at 200% zoom. 2.4.11
- Tab past every control without activating anything. Nothing should submit, navigate, or open. 3.2.1
- Change every select and checkbox. Nothing should navigate or reload without an explicit submit. 3.2.2
- Submit a form with errors. Focus should move somewhere useful, and the error must be reachable and readable. 3.3.1
What you will find, in order of frequency
outline: nonewith no replacement — no visible focus anywhere.- A
divorspanwith a click handler, unreachable by Tab. - A modal that opens without moving focus, so the keyboard user is left behind it.
- A modal that does not return focus to its trigger when closed.
- A custom dropdown that traps focus, or that arrow keys do not drive.
- Focus scrolling underneath a sticky header.
- A positive
tabindexscrambling the order.
WCAG 2.2 Demo Suite