Keyboard Accessibility Testing: The 15-Minute Manual Check
Keyboard accessibility testing in 15 minutes: a 7-step protocol, the WCAG 2.2 criteria it covers, six code fixes, a tab-walk script and data from 156 sites.
Kazi Khalid Hasan Tamim · BugViso Team
17 min read
Keyboard accessibility testing means using a page with only Tab, Shift+Tab, Enter, Space, Escape and the arrow keys, and checking that every control can be reached, seen, operated and left. It takes about 15 minutes per page template, and no automated scanner can do it for you. On 156 random homepages we tested, 62 % had at least one Tab stop with no visible focus change, and only 13 % offered a skip link.
By the end you'll have a repeatable test protocol, the seven WCAG success criteria it covers, code fixes for the six failures that break keyboard users most often, and a Python script that tabs through any page and flags invisible or covered focus.
Data used: 156 homepages that loaded cleanly, out of 268 domains drawn at random from the Tranco top-sites list (list 947V2, ranks 1,001 to 50,000), tested on 4 December 2026 with Playwright 1.52, Chromium 136 and axe-core 4.10.2 (WCAG 2.0 to 2.2 A and AA rules) at 1280 × 800 px. We excluded 112 domains that didn't resolve, failed TLS, timed out, returned an HTTP error or showed a bot challenge. Homepages only; sites aren't named. On each page our script pressed Tab up to 40 times and compared a screenshot of every focused element with one taken after it lost focus; a difference of 3 pixels or fewer counted as no visible change, and stops where the page was animating were skipped.
Manual accessibility testing series: How to run a full accessibility audit · Keyboard testing (this post) · Screen reader testing · ARIA mistakes · Accessible forms · Reflow and zoom testing
What Keyboard Accessibility Testing Actually Checks
A keyboard test checks seven WCAG success criteria at once. People who can't use a mouse (motor impairments, tremors, repetitive strain, most screen reader users) move through a page one focusable element at a time. If a control can't be reached, or they can't see where they are, the page stops working for them.
| WCAG 2.2 criterion | Level | What fails it |
|---|---|---|
| 2.1.1 Keyboard | A | A control that only responds to a mouse click or hover |
| 2.1.2 No Keyboard Trap | A | Focus enters a widget and Tab or Escape can't get it out |
| 2.4.1 Bypass Blocks | A | No skip link, landmarks or headings to jump past repeated navigation |
| 2.4.3 Focus Order | A | Tab order jumps around so the page stops making sense |
| 2.4.7 Focus Visible | AA | outline: none with no replacement: the user can't see what has focus |
| 2.4.11 Focus Not Obscured (Minimum) | AA | A sticky header, cookie banner or chat bubble completely covers the focused element |
| 3.2.1 On Focus | A | Focusing a field opens a new window, submits a form or moves the page |
2.4.11 is new in WCAG 2.2. The W3C's Understanding document names the usual culprits directly: sticky headers, sticky footers and non-modal dialogs. It also says a cookie banner fails the criterion if it entirely hides the component that receives focus.
How to Test Keyboard Accessibility in 15 Minutes
Put the mouse out of reach, open the page, and work through these steps in order. Do it on each distinct template (homepage, article, product, form, checkout), not on every URL.
- Prepare the browser. On a Mac, turn on System Settings → Keyboard → Keyboard navigation, and in Safari enable Settings → Advanced → Press Tab to highlight each item on a webpage. Without these, Safari skips links and you'll report bugs that don't exist.
- Click the address bar, then press Tab once. The first stop should be a skip link ("Skip to main content") that becomes visible. Press Enter and Tab again: focus should land inside the main content, not back in the header.
- Tab through the whole page. At every stop, answer three questions: can I see where focus is, does the order follow the visual reading order, and is the focused element fully on screen (not under a sticky bar)?
- Operate every control. Links take Enter. Buttons take Enter and Space. Checkboxes take Space. Select menus, tabs, radio groups and menus use the arrow keys.
- Open and close every overlay. Menus, modals, cookie banners, date pickers and chat widgets. Escape should close them, and focus should return to the control that opened them.
- Shift+Tab back up the page. Reverse order exposes traps that forward tabbing hides.
- Submit a form with errors. Focus should move to the first error or to an error summary, never stay on the submit button in silence.
The keys follow one rule from the W3C's guide to developing a keyboard interface: Tab moves between components, other keys move within them. A tab list, a menu or a radio group is one Tab stop; the arrow keys move inside it.
| Key | Expected behaviour |
|---|---|
| Tab / Shift+Tab | Next / previous focusable component |
| Enter | Follow a link, press a button, submit |
| Space | Press a button, toggle a checkbox, scroll the page |
| Arrow keys | Move within radio groups, tabs, menus, sliders, listboxes |
| Escape | Close a dialog, menu or popup and return focus to its trigger |
| Home / End | First / last item in a list, menu or tab set |
What We Found Tabbing Through 156 Homepages
Almost every homepage let a keyboard user move. Far fewer let them see where they were. Our script pressed Tab up to 40 times on every homepage in the sample, recorded each stop, and compared a screenshot of the focused element with one taken after it lost focus. Identical screenshots mean the user sees no change when focus arrives.
| What we measured | Homepages | Share |
|---|---|---|
| Tab reached at least one element | 154 of 156 | 98.7 % |
| At least one stop with no visible focus change | 97 of 156 | 62.2 % |
| Centre of the focused element covered by another element (sticky header, banner, chat launcher) | 54 of 156 | 34.6 % |
Focus landed on an element the user can't see (under 2 px, transparent or visibility: hidden) | 40 of 156 | 25.6 % |
| Focus stayed on one element for 3+ Tab presses, outside iframes (likely trap) | 21 of 156 | 13.5 % |
| Skip link among the first three stops | 20 of 156 | 12.8 % |
| Visible element with an interactive ARIA role that Tab never reaches | 15 of 156 | 9.6 % |
Positive tabindex anywhere on the page | 6 of 156 | 3.8 % |
| axe-core flagged a keyboard-related rule | 21 of 156 | 13.5 % |
Counted by stop rather than by site, 1,040 of the 3,442 measurable stops (30.2 %) showed no visible change when focus arrived. That's the gap between automation and a keyboard test in one number: axe-core's keyboard-related rules (scrollable-region-focusable, nested-interactive, aria-hidden-focus, frame-focusable-content) fired on 13.5 % of homepages, while the tab walk found an invisible focus state on 62.2 %. Where skip links existed they mostly worked: 19 of the 20 became visible when focused.
💡 Rule of thumb: If your design system sets
outline: noneanywhere, assume at least one component lost its focus style. Search the CSS before you open the page.
The 6 Keyboard Failures and How to Fix Each One
1. The focus ring was removed and never replaced
outline: none usually arrives because someone disliked the ring on mouse click. The fix is :focus-visible, which browsers apply only when they decide a visible indicator helps, typically after keyboard input. MDN's :focus-visible reference describes these heuristics.
/* ❌ Broken: no indicator for anyone */
a:focus, button:focus { outline: none; }/* ✅ Fixed: no ring on mouse click, a clear ring on keyboard focus */
:focus:not(:focus-visible) { outline: none; }
:focus-visible {
outline: 3px solid #1d4ed8;
outline-offset: 2px;
}Aim for an indicator at least 2 CSS px thick with 3:1 contrast against the colours around it. That is the target WCAG 2.2 sets in its AAA criterion 2.4.13 Focus Appearance, and outline meets it easily.
2. A div pretends to be a button
A <div onclick> gets no Tab stop, no Enter or Space handling and no role. It works with a mouse and nothing else.
<!-- ❌ Broken: not focusable, not announced, ignores the keyboard -->
<div class="btn" onclick="openCart()">Cart</div><!-- ✅ Fixed: focusable, Enter and Space work, announced as a button -->
<button type="button" class="btn" onclick="openCart()">Cart</button>If you truly can't change the element, you need role="button", tabindex="0" and a keydown handler for both Enter and Space. Three additions to replace one native element is why the rule is "use <button>". Our post on common ARIA mistakes measures how often this pattern ships.
3. A sticky header covers the focused element
When the browser scrolls a focused link into view, it can align it with the top edge of the viewport, exactly where a sticky header sits. The W3C's Understanding document for 2.4.11 points to scroll padding as one fix.
/* ✅ Fixed: keep focused elements clear of an 80 px sticky header */
html { scroll-padding-top: 88px; }
/* and the same for a sticky footer or cookie bar */
html { scroll-padding-bottom: 96px; }Cookie banners need a decision: either make the banner a real modal (focus goes into it first, the page behind is inert) or keep it small enough that it never fully covers a focused control.
4. Focus lands on something invisible
Off-canvas menus, collapsed accordions and carousels often hide content visually but leave its links in the Tab order. The keyboard user presses Tab and focus vanishes for several stops.
<!-- ❌ Broken: moved off screen, still focusable -->
<nav class="drawer" style="transform: translateX(-100%)">…</nav><!-- ✅ Fixed: inert removes the closed drawer from the Tab order and the accessibility tree -->
<nav class="drawer" inert>…</nav>
<script>
toggle.addEventListener('click', () => drawer.toggleAttribute('inert'));
</script>MDN's inert reference confirms the effect: an inert element and everything inside it can't be focused and leaves the accessibility tree. display: none or visibility: hidden on the closed state works too.
5. The skip link is missing or broken
A skip link must be the first Tab stop, appear when focused, and move focus to the main content.
<!-- ✅ Fixed: first element in <body> -->
<a class="skip-link" href="#main">Skip to main content</a>
…
<main id="main" tabindex="-1">…</main>.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 1000; }The tabindex="-1" on <main> lets the browser move focus there reliably when the link is followed. It doesn't add a Tab stop.
6. A modal lets focus escape, or never lets it out
Two opposite failures: focus wanders behind an open modal, or the modal traps focus with no way to close it. The native <dialog> element opened with showModal() handles both: the rest of the page becomes inert and Escape closes it.
<dialog id="newsletter">
<h2>Get the checklist</h2>
<form method="dialog"><button>Close</button></form>
</dialog>
<script>
let opener;
function openDialog(btn) { opener = btn; newsletter.showModal(); }
newsletter.addEventListener('close', () => opener?.focus()); // back to the trigger
</script>One more anti-pattern deserves a line of its own: positive tabindex values (tabindex="3"). They pull elements ahead of the natural order and scramble it everywhere else. MDN's tabindex reference recommends using only 0 and -1.
Run It Yourself: Tab Through Any Page With Python
The script below presses Tab, records each stop and flags three problems: NO RING (the focused element looks identical when unfocused), HIDDEN (focus is on something with no size or opacity) and COVERED (another element sits on top of the focused one's centre).
#!/usr/bin/env python3
"""Tab through a page and report every focus stop a keyboard user meets.
Usage: python tab_walk.py https://example.com [max_stops]
Needs: pip install playwright pillow && playwright install chromium
Flags: NO RING (focused and unfocused look identical), HIDDEN (focus on an
invisible element), COVERED (another element sits on the focused one's centre).
"""
import asyncio, io, sys
from PIL import Image, ImageChops
from playwright.async_api import async_playwright
FOCUS = """() => { const e = document.activeElement;
if (!e || e === document.body) return null;
const r = e.getBoundingClientRect(), s = getComputedStyle(e);
const x = r.left + r.width / 2, y = r.top + r.height / 2;
const top = document.elementFromPoint(Math.max(0, Math.min(x, innerWidth - 1)), Math.max(0, Math.min(y, innerHeight - 1)));
let k = e.tagName, p = e; for (let i = 0; i < 5 && p.parentElement; i++) { p = p.parentElement; k = p.tagName + [...p.children].indexOf(e) + '>' + k; }
return { key: k + (e.id || '') + (e.getAttribute('href') || '') + (e.innerText || '').slice(0, 30), label: (e.tagName + ' ' + (e.innerText || e.getAttribute('aria-label') || e.getAttribute('href') || '')).trim().slice(0, 50),
box: [r.left, r.top, r.width, r.height],
hidden: r.width < 2 || r.height < 2 || s.visibility === 'hidden' || +s.opacity === 0,
covered: !!top && !(top === e || e.contains(top) || top.contains(e)) }; }"""
def changed(a, b):
d = ImageChops.difference(Image.open(io.BytesIO(a)).convert("L"), Image.open(io.BytesIO(b)).convert("L"))
return d.point(lambda v: 255 if v > 40 else 0).histogram()[255]
async def main(url, limit):
async with async_playwright() as pw:
page = await (await pw.chromium.launch()).new_page(viewport={"width": 1280, "height": 800})
await page.goto(url, wait_until="domcontentloaded")
await page.wait_for_timeout(2000)
await page.add_style_tag(content="*{animation:none!important;transition:none!important;caret-color:transparent!important}")
seen = set()
for n in range(1, limit + 1):
await page.keyboard.press("Tab")
f = await page.evaluate(FOCUS)
if f is None or f["key"] in seen:
print(f"{n:>3} (focus left the page or looped: walk ends)"); break
seen.add(f["key"])
flags = []
if f["hidden"]:
flags.append("HIDDEN")
else:
x, y, w, h = f["box"]
clip = {"x": max(x - 6, 0), "y": max(y - 6, 0), "width": w + 12, "height": h + 12}
try:
on = await page.screenshot(clip=clip)
await page.evaluate("document.activeElement.blur()")
if changed(on, await page.screenshot(clip=clip)) <= 3:
flags.append("NO RING")
except Exception:
flags.append("off-screen")
if f["covered"]:
flags.append("COVERED")
print(f"{n:>3} {f['label']:<52} {' '.join(flags)}")
asyncio.run(main(sys.argv[1], int(sys.argv[2]) if len(sys.argv) > 2 else 40))We ran it on our own homepage before publishing. Trimmed, unedited output:
$ python tab_walk.py https://bugviso.com
1 A BugViso home
2 BUTTON What it checks
3 A AI visibility
…
9 BUTTON Audit my website
10 BUTTON Track AI visibility
11 INPUT Company domain NO RING
12 BUTTON Run an audit
…
20 BUTTON AI search readiness off-screen COVEREDIt found two problems on our own page. The hero's domain field shows no visible change when it receives keyboard focus, and a tab inside a horizontally scrolling panel takes focus while it sits outside the viewport. Neither shows up in an axe-core scan. That's the point of the walk: it turns "looks fine to me" into a list a developer can work through.
The script is a triage aid, not a verdict. A focus style that is only a subtle colour shift may pass the pixel test and still be hard to see. Look at every flagged stop yourself, and at a few unflagged ones.
What BugViso Catches Before You Pick Up the Keyboard
BugViso's accessibility engine runs axe-core's WCAG 2.0, 2.1 and 2.2 A and AA rules on every page it crawls, including the keyboard rules a machine can decide from the DOM. Those are scrollable-region-focusable (a scrolling box the keyboard can't reach), nested-interactive (a button inside a link, which keyboards and screen readers handle unpredictably), aria-hidden-focus (a focusable element hidden from assistive technology) and frame-focusable-content. Each finding keeps axe-core's impact level, the CSS selector and the failing HTML, so you know which template to open.
What it doesn't do is press Tab for you. Focus visibility, focus order, traps and covered focus need the manual walk or the script above. The sensible split is to let the WCAG accessibility audit clear the machine-checkable failures across the whole site, then spend your 15 minutes per template on the keyboard checks only a person can judge.
Traps and Edge Cases
- Third-party iframes. Chat widgets, embedded booking forms and video players run their own focus logic. You can't fix their code, but you can pick a vendor whose widget passes your keyboard test.
- Single-page app route changes. When the URL changes without a page load, focus often stays on the clicked link, which no longer exists. Move focus to the new page's
<h1>(withtabindex="-1") after each route change. - Hover-only menus. A mega menu that opens on
:hoverneeds a button that opens it on Enter or Space, witharia-expandedreflecting its state. - Custom selects and date pickers. Most custom versions skip arrow-key support. Test them separately, or keep the native
<select>and<input type="date">. - Focus after deletion. Removing an item from a list or cart deletes the focused element. Send focus somewhere sensible (the next item, or the list heading) instead of letting it fall back to
<body>. - Phones with a keyboard. Many people pair a Bluetooth keyboard with a phone or tablet. Repeat the walk at mobile width; collapsed navigation is where most of these failures hide.
Frequently Asked Questions
Can automated tools test keyboard accessibility?
Only partly. A scanner can find elements that are clearly unreachable (a scrolling region with no focusable content, a focusable element hidden with aria-hidden), but it can't tell whether focus is visible, whether the order makes sense or whether a widget traps focus. In our sample, axe-core flagged a keyboard-related rule on 13.5 % of homepages, while the tab walk found a stop with no visible focus on 62.2 %. A person, or a tab-walking script reviewed by a person, has to do the rest.
What is a keyboard trap in accessibility?
A keyboard trap is a component that focus can enter but not leave with the keyboard: Tab and Shift+Tab cycle inside it and Escape does nothing. WCAG 2.1.2 No Keyboard Trap (Level A) forbids it. Embedded media players, rich text editors and badly built modals are the usual causes. A modal that keeps focus inside while open is correct, as long as Escape or a close button lets the user out.
Is outline: none a WCAG failure?
Not by itself, but it usually causes one. WCAG 2.4.7 Focus Visible (Level AA) requires a visible indicator when focus comes from the keyboard. If you remove the default outline you must replace it, for example with a :focus-visible style. Removing it everywhere with no replacement fails 2.4.7.
How do I test keyboard accessibility on a Mac?
Turn on System Settings → Keyboard → Keyboard navigation, then in Safari enable Settings → Advanced → Press Tab to highlight each item on a webpage. Without that second setting, Tab in Safari moves only between form fields and buttons, so links look unreachable when they aren't. Chrome and Firefox on macOS follow the system setting.
Does every website need a skip link?
WCAG 2.4.1 Bypass Blocks (Level A) requires a way to skip blocks repeated on every page. Proper landmarks and headings can meet it, but they mainly help screen reader users, who have commands to jump between them. A skip link that appears on focus also helps sighted keyboard users, so add one to any site with more than a handful of header links.
How often should I run a keyboard test?
On every template after any change to navigation, modals, forms or the design system's focus styles, and before every major release. A component that passed last quarter fails the day someone adds outline: none to a shared stylesheet.
The One Check to Run Before Every Release
If you only have time for one manual accessibility test, make it this one: put the mouse away, press Tab from the top of each template, and fix every stop where you can't see or reach focus. Pair it with a automated audit so the machine-checkable failures are already gone before you start.
Written by
Kazi Khalid Hasan Tamim · BugViso Team
Kazi writes BugViso’s guides on website audits, Core Web Vitals, technical SEO, accessibility and AI search. The data in them comes from audits BugViso runs in a real Chromium browser, including our 219-site study of website health.
Summarise with AI
Open this guide in your assistant.
Follow BugViso
New guides and audit data as we publish them.
AI visibility tracker
Is your brand in AI answers?
See how often AI assistants mention you, cite your site and rank you against your competitors.
- ChatGPT
- Gemini
- Perplexity
- Claude
- AI Overviews
See where your site stands
Run a free BugViso audit for SEO, speed, accessibility and AI search readiness — with fixes you can ship today.