xtest

Accessibility Testing

Accessibility Testing Guidelines

This course teaches QA professionals, developers, and testers how to systematically evaluate web and mobile applications for accessibility, ensuring they can be used by people with visual, auditory, motor, and cognitive disabilities. You will learn the WCAG success criteria that define accessible design, how to combine automated scanning tools with manual keyboard and screen reader testing, and how to prioritize and report the defects you find. The course covers the POUR principles, conformance levels, common automated testing libraries such as axe-core, manual testing techniques including keyboard-only navigation and screen reader walkthroughs, and how to build a repeatable accessibility testing process that fits into a regular QA workflow. By the end, you will be able to run a credible accessibility audit on a real application and communicate findings clearly to a development team.

Intermediate · By the Xtest team · About 36 minutes to read

Introduction

Accessibility testing verifies that digital products can be used by people with a wide range of abilities, including those who rely on screen readers, keyboard-only navigation, switch devices, or screen magnification. It is not a one-time audit but an ongoing practice that belongs alongside functional and regression testing in any mature QA process. Many teams assume that running an automated scanner is enough, but automated tools can only catch a fraction of real accessibility barriers; the rest require a human to navigate the interface the way an assistive technology user actually would. This course is built around that reality. You will start with the foundational concepts behind the Web Content Accessibility Guidelines (WCAG), understanding what the four POUR principles mean in practice and how conformance levels A, AA, and AA are defined and tested against. From there, you will move into hands-on testing techniques: wiring automated accessibility checks into a test suite with tools like axe-core, performing manual keyboard-only walkthroughs, and using screen readers such as NVDA, JAWS, or VoiceOver to experience a page the way a blind user would. You will also learn how to triage accessibility findings by severity, write defect reports that developers can act on, and build a testing strategy that combines automated coverage with periodic manual audits. Whether you are new to accessibility testing or looking to formalize an ad hoc practice into a repeatable process, this course gives you the vocabulary, tools, and workflow to do it well.

Foundations of Web Accessibility and WCAG

Why Accessibility Testing Matters

Accessibility testing exists to answer one question: can a person with a disability actually use this product? That includes people who are blind or have low vision and rely on screen readers or magnification, people with motor impairments who cannot use a mouse, people who are deaf or hard of hearing, and people with cognitive or learning disabilities who need clear, predictable interfaces. Unlike most functional testing, accessibility testing requires you to think about how something is used, not just whether it works.

The WCAG Framework

The Web Content Accessibility Guidelines (WCAG), published by the W3C, are the standard reference for accessible design and the basis for most legal and organizational accessibility requirements. WCAG is organized around four principles, commonly abbreviated as POUR:

  • Perceivable: information and interface components must be presentable to users in ways they can perceive (for example, text alternatives for images).
  • Operable: interface components and navigation must be operable (for example, everything reachable by keyboard).
  • Understandable: information and the operation of the interface must be understandable (for example, consistent navigation, clear error messages).
  • Robust: content must be robust enough to be interpreted reliably by a wide variety of user agents, including assistive technologies.

Each principle breaks down into guidelines, and each guideline breaks down into testable success criteria. A success criterion is the actual unit you test against, for example "1.1.1 Non-text Content" requires that every image has a text alternative.

Combining Automated and Manual Checks

Automated scanners are good at catching objective, rule-based violations such as missing alt text, insufficient color contrast, or missing form labels, but they cannot judge whether an alt text is actually meaningful or whether a keyboard tab order makes logical sense. A thorough accessibility test pairs an automated scan with a manual review. As one example of this pairing in a hosted testing tool, xtest's Accessibility test agent checks the WCAG 2.0 to 2.2 A and AA rules with axe-core on the live page, then walks the page by keyboard. That same two-step pattern, automated rule-checking followed by manual keyboard and screen reader review, is the core workflow this section teaches you to perform yourself with open tools.

What You Will Learn in This Section

By the end of this section you will understand the POUR principles well enough to recognize violations by category, know the difference between conformance levels A, AA, and AAA, and be able to run your first automated accessibility scan using axe-core against a real page.

The Four POUR Principles in Practice

Perceivable means users must be able to perceive the information being presented, regardless of sense impairment. In practice this means every meaningful image has descriptive alt text, videos have captions, and content is never conveyed by color alone (for example, an error field should not rely only on turning red; it needs an icon or text label too). Color contrast between text and its background must meet a minimum ratio so that people with low vision can read it.

Operable means every interactive element, links, buttons, form fields, menus, must be reachable and usable with a keyboard alone, with no mouse required. This includes a visible focus indicator so a sighted keyboard user can see where they are, a logical tab order that follows the visual reading order, and no keyboard traps where focus gets stuck inside a widget like a modal with no way out. Time limits on tasks must be adjustable or removable, and nothing should flash rapidly enough to trigger seizures.

Understandable means the content and the behavior of the interface are predictable. Form fields need visible labels, not just placeholder text that disappears when typing starts. Error messages must say specifically what went wrong and how to fix it, not just display a red border. Navigation should remain consistent across pages of the same site, and language should be set correctly in the page markup so screen readers pronounce it properly.

Robust means the underlying code is well-formed enough that current and future assistive technologies can parse it reliably. This usually comes down to using semantic HTML elements (buttons as <button>, not <div onclick>) and correct ARIA attributes only where native HTML cannot express the needed role or state. Overusing ARIA, or using it incorrectly, often creates more accessibility problems than it solves, so the first rule of ARIA is to use native HTML elements whenever one exists for the job.

Conformance Levels A, AA, and AAA

WCAG organizes its success criteria into three conformance levels of increasing strictness. Level A covers the most basic accessibility requirements; failing these makes content impossible or extremely difficult for some users to access at all, for example missing alt text on an informative image or a form with no labels. Level AA is the level most organizations target and the one most legal and procurement requirements reference; it includes stronger color contrast requirements, resizable text, and consistent navigation and identification across pages. Level AAA is the strictest level and is not expected of entire sites because some AAA criteria are difficult or impossible to satisfy for all types of content, such as providing sign language interpretation for every video; AAA criteria are usually applied selectively where they matter most.

When you test, you test against specific success criteria, not against a vague idea of "accessible." For example, to test success criterion 1.4.3 (Contrast Minimum, Level AA) you measure the contrast ratio between text and its background and compare it against the 4.5:1 threshold for normal text. To test 2.1.1 (Keyboard, Level A) you unplug your mouse and attempt every task using only Tab, Shift+Tab, Enter, Space, and arrow keys.

Most teams set Level AA as their target conformance level because it balances meaningful accessibility with practical achievability, and it is the level most referenced by accessibility laws and standards worldwide. Knowing which level a given success criterion belongs to helps you prioritize fixes: a Level A failure blocking basic access should always be fixed before a Level AAA nicety.

const { chromium } = require('playwright');
const { AxeBuilder } = require('@axe-core/playwright');

(async () => {
  const browser = await chromium.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');

  const results = await new AxeBuilder({ page })
    .withTags(['wcag2a', 'wcag2aa'])
    .analyze();

  console.log(`Violations found: ${results.violations.length}`);
  results.violations.forEach((violation) => {
    console.log(`- [${violation.impact}] ${violation.id}: ${violation.description}`);
    violation.nodes.forEach((node) => {
      console.log(`    element: ${node.target}`);
    });
  });

  await browser.close();
})();

Runs an automated accessibility scan with axe-core against a live page using Playwright, filtering for WCAG 2.0/2.1 Level A and AA rules, and prints each violation with its severity and the offending element.

# Install axe-core's CLI-friendly wrapper for quick command-line scans
npm install -g @axe-core/cli

# Scan a URL directly from the terminal
axe https://example.com --tags wcag2a,wcag2aa --save results.json

# Inspect the saved results
cat results.json | jq '.[0].violations | length'

Uses the axe-core command-line tool to scan a URL for WCAG A and AA violations without writing any test code, useful for quick spot checks during manual exploration.

Tips

  • Always test color contrast with an actual contrast checker tool rather than eyeballing it; some combinations that look fine to sighted testers fail the 4.5:1 ratio.
  • When you find a violation, note which success criterion it maps to (for example '1.1.1 Non-text Content') so developers can look up the exact requirement rather than guessing at what 'accessibility' means.
  • Treat automated scan results as a floor, not a ceiling: a page with zero axe-core violations can still be unusable with a screen reader or keyboard.

Common pitfalls

  • Treating an automated scan as a complete accessibility audit. Automated tools typically catch a minority of real-world WCAG issues; always pair them with manual keyboard and screen reader testing.
  • Adding ARIA attributes to fix a scanner warning without understanding what the attribute does. Incorrect ARIA (like aria-hidden on focusable content) can make a page less accessible than having no ARIA at all; prefer semantic HTML first.

Manual Accessibility Testing Techniques

Automated scanners catch a meaningful share of accessibility issues, but many barriers only surface when a human works through an interface the way a real user would. Manual testing fills that gap by exercising the product with a keyboard, a screen reader, and a careful eye for visual and interactive details that automated rules cannot judge. This section walks through the core manual techniques every tester should practice: keyboard-only navigation, focus management, screen reader verification, and hands-on checks of color contrast, zoom, and form error handling.

Manual testing is slower than running an automated scan, but it is the only reliable way to confirm that what a screen reader announces actually makes sense, that focus lands where a sighted keyboard user expects it to, and that an error message is both visible and announced. Treat manual testing as a complement to automated checks rather than a replacement: automated tools are fast and consistent for rule-based issues like missing alt text or insufficient contrast ratios, while manual testing is better at judging context, flow, and the real experience of assistive technology users.

A practical workflow combines both. Run an automated scan first to clear out structural issues quickly, then spend manual testing time on the interactions and content that need human judgment. Some platforms now blend the two: xtest's Accessibility test agent checks the WCAG 2.0 to 2.2 A and AA rules with axe-core directly on the live page, then walks the page by keyboard, which mirrors the exact sequence described below and can be a useful starting point before deeper manual review.

The subsections that follow give step-by-step techniques, a sample automated check you can run alongside manual testing, and a list of pitfalls that trip up even experienced testers.

Keyboard Navigation and Focus Management

Unplug or ignore the mouse and navigate the entire interface using only Tab, Shift+Tab, Enter, Space, and arrow keys. Every interactive element, links, buttons, form fields, menus, custom widgets, must be reachable and operable this way. As you tab through the page, watch for a visible focus indicator on each element; a focus outline that disappears or is only a faint color change fails many users who rely on sight to track their position.

Check the focus order against the visual and logical layout of the page. Focus should move in a sequence that makes sense, typically left to right and top to bottom, following the reading order rather than the raw DOM order if they differ. A common failure is a modal dialog that opens but leaves focus behind on the page underneath, or a dialog that closes without returning focus to the element that opened it.

Test every custom widget individually: dropdowns should open with Enter or Space and close with Escape, date pickers should allow arrow-key navigation between days, and tab panels should expose their tabs as a single stop with arrow keys moving between them. Also confirm there is no keyboard trap, a spot where Tab moves you in but no combination of keys moves you back out. Keyboard traps are especially common in third-party embedded widgets like maps or rich text editors.

Finally, verify that skip links exist and work: a 'Skip to main content' link should appear on focus near the top of the page and jump focus past repeated navigation. Testers should perform this entire pass on every new page template and after any significant UI change, since a single CSS update can silently remove focus styles across an entire site.

Screen Reader and Visual Accessibility Checks

Screen reader testing confirms that what is announced matches what a sighted user sees and understands. Test with at least one screen reader per platform: NVDA or JAWS with a Windows browser, and VoiceOver on macOS or iOS. Navigate by headings, landmarks, and form fields using the screen reader's own navigation keys, not just Tab, since many issues only appear when jumping directly to an element. Listen for whether images have meaningful alternative text, whether form fields announce their label and any error state, and whether dynamic content, like a success message or a validation error, is announced automatically through a live region rather than silently appearing on screen.

Color contrast should be checked by hand even after an automated scan, since automated tools can miss text over images or gradients. Use a contrast-checking browser extension or the browser's own accessibility inspector to sample real rendered colors, not just the values in the stylesheet, since overlays, opacity, and hover states change the final color.

Zoom and text resizing testing means setting the browser to 200% zoom, or increasing the OS text size, and confirming content reflows without horizontal scrolling, text does not get clipped, and all functionality remains usable. Finally, test form error handling by submitting a form with invalid or missing data and confirming that the error is described in text near the field, associated with the field programmatically, and announced by a screen reader the moment it appears, not just shown as a red border.

const { chromium } = require('playwright');
const AxeBuilder = require('@axe-core/playwright').default;

(async () => {
  const browser = await chromium.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com/checkout');

  const results = await new AxeBuilder({ page }).analyze();
  console.log(`Violations found: ${results.violations.length}`);
  results.violations.forEach(v => {
    console.log(`- ${v.id}: ${v.description} (impact: ${v.impact})`);
  });

  await browser.close();
})();

A Playwright script that loads a page and runs an axe-core accessibility scan, printing each violation with its severity. Use this as a fast pre-check before spending time on manual keyboard and screen reader testing.

// Manual keyboard navigation smoke test with Playwright
const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch({ headless: false });
  const page = await browser.newPage();
  await page.goto('https://example.com/signup');

  for (let i = 0; i < 15; i++) {
    await page.keyboard.press('Tab');
    const active = await page.evaluate(() => {
      const el = document.activeElement;
      return el ? `${el.tagName}#${el.id || '(no id)'}` : 'none';
    });
    console.log(`Tab ${i + 1}: focused on ${active}`);
  }

  await browser.close();
})();

A simple script that presses Tab repeatedly and logs which element receives focus at each step, useful for spotting broken focus order or elements that never receive focus.

Tips

  • Always test keyboard navigation before screen reader testing, since a broken focus order will make screen reader results confusing and hard to interpret.
  • Keep a checklist of landmark roles (banner, navigation, main, contentinfo) and headings, and verify with a screen reader that they are announced correctly, not just present in the HTML.
  • Resize text and zoom the browser early in a design review, not after development is finished, since reflow problems are much cheaper to fix before layout is locked in.

Common pitfalls

  • Relying only on an automated scanner and skipping manual keyboard and screen reader passes: automated tools cannot judge whether announced text makes sense in context, so manual verification is still required for a real accessibility review.
  • Testing focus indicators only in a default browser state: hover and active CSS states sometimes hide the focus outline, so testers should check focus visibility separately from hover and click states, not assume one implies the other.

Automated Accessibility Testing Tools and CI Integration

Automated accessibility testing catches a meaningful slice of WCAG violations early and cheaply, before a human auditor ever opens the page. The landscape includes several mature open-source libraries, each with a different sweet spot: axe-core for in-page rule checking that plugs into almost any test runner, Pa11y for simple command-line and CI-friendly scans, and Lighthouse for a broader performance-plus-accessibility audit that product teams already run. None of these tools replace manual testing or a real screen reader session, but they remove the repetitive, rule-based work so human testers can focus on judgment calls like reading order, focus management, and whether an ARIA label actually makes sense in context.

The real value of automation shows up when checks run on every pull request rather than once a quarter. Wiring a library into CI means a regression is caught within minutes of being introduced, while the diff is still fresh in the author's mind, rather than surfacing weeks later in a dedicated audit. This section covers the two practical pieces of making that work: choosing and configuring a tool, and building a CI pipeline that fails builds on real violations without burying the team in noise.

One detail worth knowing: xtest's Accessibility test agent checks the WCAG 2.0 to 2.2 A and AA rules with axe-core on the live page, then walks the page by keyboard. That combination mirrors the two testing modes discussed below: automated rule scanning plus a manual-style keyboard pass, run together rather than as separate efforts.

Choosing Between axe-core, Pa11y, and Lighthouse

axe-core is a JavaScript library that runs rule checks directly against the DOM, which makes it the easiest to embed inside existing test suites written with Playwright, Cypress, or Jest. It is fast, has a low false-positive rate compared to older tools, and returns structured JSON with the exact element, the rule violated, and an impact rating (minor, moderate, serious, critical).

Pa11y wraps a headless browser and exposes a simple command-line interface, which makes it attractive for teams that want a quick scan of a URL list without writing test code. Pa11y CI, its companion tool, reads a JSON config of URLs and thresholds and is built specifically to run as a CI step.

Lighthouse audits a page for performance, SEO, best practices, and accessibility in one pass, using a subset of axe-core rules under the hood. It is a good fit when a team already tracks Lighthouse scores for performance and wants accessibility folded into the same report, but its accessibility coverage is narrower than running axe-core directly.

A practical approach: use axe-core inside component and end-to-end tests for fast, specific feedback tied to a particular flow, and use Pa11y or Lighthouse for broader sweeps across every page in a sitemap. Running more than one tool is not redundant, since each implements a slightly different rule set and catches different violations; the overlap is also what builds confidence that a passing page is genuinely clean.

Wiring Checks into CI and Triaging Results

The mechanics of CI integration are straightforward: run the accessibility check as a step after the build, write results to a file, and fail the job if violations above a chosen severity are found. The harder part is deciding what should actually fail the build. Treating every violation as a blocker trains a team to ignore the tool, because minor issues (a slightly low-contrast decorative icon, for instance) will appear constantly and rarely matter as much as a missing form label or an unlabeled button.

A workable triage policy: fail the build only on 'serious' and 'critical' impact violations, and report 'minor' and 'moderate' ones as warnings that get reviewed weekly rather than blocking merges. New violations on changed files should be weighted more heavily than pre-existing ones on untouched legacy pages, since fixing everything at once is rarely realistic.

It also helps to version the rule set. axe-core and Lighthouse both update their rules over time, and a sudden jump in violation count after a library upgrade is usually the ruleset changing, not the app regressing. Pinning versions and reviewing rule changes before bumping them keeps CI failures meaningful.

Finally, automated tools only catch what is programmatically detectable: missing alt text, poor contrast ratios, missing labels, invalid ARIA usage. They cannot judge whether a heading hierarchy makes logical sense to a screen reader user or whether a focus order feels right, which is why CI checks should be paired with periodic manual and keyboard-only passes.

const { test, expect } = require('@playwright/test');
const AxeBuilder = require('@axe-core/playwright').default;

test('homepage has no serious or critical accessibility violations', async ({ page }) => {
  await page.goto('https://example.com');

  const results = await new AxeBuilder({ page })
    .withTags(['wcag2a', 'wcag2aa', 'wcag21aa'])
    .analyze();

  const blocking = results.violations.filter(
    (v) => v.impact === 'serious' || v.impact === 'critical'
  );

  expect(blocking, JSON.stringify(blocking, null, 2)).toHaveLength(0);
});

A Playwright test that runs axe-core against a live page and fails only on serious or critical violations, keeping minor noise from blocking the build.

#!/usr/bin/env bash
set -e

npx pa11y-ci --config pa11yci.json --threshold 0

# pa11yci.json example:
# {
#   "urls": [
#     "https://example.com/",
#     "https://example.com/login",
#     "https://example.com/checkout"
#   ],
#   "defaults": {
#     "standard": "WCAG2AA",
#     "timeout": 10000
#   }
# }

A CI script that runs Pa11y CI across a list of key pages against WCAG2AA, failing the pipeline if any violation is found; the threshold can be raised to tolerate a small, known baseline.

Tips

  • Run automated checks against both the authenticated and unauthenticated versions of a page, since logged-in-only content is often skipped by crawlers and never tested.
  • Store a baseline of known, accepted violations so CI flags only new regressions instead of re-reporting the same unresolved issues every build.
  • Scan pages in multiple states (empty, loading, error, filled forms) since many accessibility bugs only appear after user interaction, not on first load.

Common pitfalls

  • Failing the build on every violation regardless of severity, which teaches developers to ignore or disable the check entirely; scope CI failures to serious and critical impact levels instead.
  • Treating a clean automated scan as proof the page is accessible. Automated tools catch roughly a third to half of common issue types at best and miss things like logical reading order or whether ARIA labeling is actually meaningful, so pair automation with manual keyboard and screen reader review.

Screen Readers and Assistive Technology Deep Dive

Automated checks catch a large share of accessibility problems, but screen readers remain the ground truth for how assistive technology users actually experience a page. This section builds the manual testing skills that automated tools cannot replace: running structured passes with NVDA, JAWS, and VoiceOver, understanding how semantic HTML and ARIA roles get translated into the accessibility tree, and extending that practice to mobile with TalkBack and iOS VoiceOver.

A structured screen reader pass is not random clicking with the screen reader on. It is a repeatable script: navigate by heading, navigate by landmark, navigate by form field, navigate by link, and then navigate linearly with Tab and arrow keys. Each pass should answer a specific question: do headings describe the page's outline, do landmarks let a user jump straight to main content, do form fields announce their label and any error, and does focus order match the visual reading order.

Semantic HTML remains the most reliable way to get correct announcements, because a <button>, <nav>, or <table> already carries its role, name, and state without extra markup. ARIA should be treated as a patch for the gaps semantic HTML leaves, not a replacement for it. A <div role="button"> needs tabindex, a keyboard handler, and sometimes aria-pressed to behave like a real button; a native <button> needs none of that. Testing both versions side by side with a screen reader quickly shows how much ARIA has to recreate by hand.

Mobile testing with TalkBack and VoiceOver on iOS follows the same structured-pass logic but adds swipe gestures instead of keyboard navigation, and introduces its own pitfalls around custom components and dynamic content. The xtest Accessibility test agent checks the WCAG 2.0 to 2.2 A and AA rules with axe-core on the live page and then walks it by keyboard, and it runs in a reduced form on phones, which makes it a useful first pass before a manual screen reader session rather than a replacement for one.

Desktop Screen Readers: NVDA, JAWS, and the Accessibility Tree

NVDA and JAWS both read from the accessibility tree that the browser builds out of the DOM, so the first debugging step for any bad announcement is to inspect that tree, not the screen reader's output alone. Browser DevTools expose an Accessibility panel showing the computed name, role, and value for any element, and this is where mismatches between visual design and semantic markup surface fastest.

A structured NVDA or JAWS pass should cover five navigation modes: by heading (H key), by landmark (D key in NVDA), by form field (F key), by link (K key), and by table (T key). Run each mode on every page template, not just the homepage, because templates often diverge once real content and dynamic widgets are added. Pay particular attention to live regions: a toast notification or inline validation message needs aria-live="polite" or role="alert" to be announced without the user having to move focus to it manually.

A common failure mode is a heading structure that looks right visually but skips levels in the DOM, for example jumping from an <h2> to an <h4>. Sighted users never notice this because font size and weight are controlled by CSS, but a screen reader user navigating by heading level hears a confusing jump and may assume content is missing. Testing with the heading-navigation mode on both NVDA and JAWS, since they can render edge cases slightly differently, should be a standard step in every structured pass rather than an occasional spot check.

VoiceOver on iOS and TalkBack on Android

Mobile screen readers trade keyboard shortcuts for touch gestures, and testers need fluency in both before a mobile pass is meaningful. VoiceOver on iOS uses a single right-swipe to move to the next element and a double-tap to activate it; TalkBack on Android follows a similar swipe-based model with its own gesture set. The core testing questions carry over from desktop: does every interactive element have a clear accessible name, does focus order match visual order, and are state changes announced.

Mobile introduces pitfalls that rarely show up on desktop. Custom sliders, date pickers, and swipeable carousels often capture touch gestures in ways that conflict with the screen reader's own gestures, trapping a VoiceOver or TalkBack user inside a component with no way out except restarting the app. Icon-only buttons are another frequent failure: a trash-can icon with no accessible label reads as "button" with no indication of what it does, whereas a label of accessibilityLabel="Delete item" on iOS or contentDescription="Delete item" on Android fixes it directly in the native layer.

Dynamic content loaded after the initial screen render, such as a spinner that resolves into a list, needs an explicit focus move or a live-region equivalent so the screen reader announces the new content instead of staying silent. Because mobile screen reader testing is slower and more gesture-dependent than desktop, running an automated accessibility check first to catch missing labels and contrast issues, then reserving manual VoiceOver and TalkBack passes for flow and focus-order questions, keeps the testing time proportional to the risk.

<!-- Poor: div styled as a button, no semantics -->
<div class="btn" onclick="deleteItem()">Delete</div>

<!-- Better: native button, label is automatic -->
<button type="button" onclick="deleteItem()">Delete</button>

<!-- When a custom control is unavoidable, ARIA fills the gap -->
<div role="button" tabindex="0" aria-pressed="false"
     onclick="deleteItem()" onkeydown="handleKey(event)">
  Delete
</div>

Shows the progression from a non-semantic clickable div to a native button, and the ARIA attributes a custom control needs to behave like one when a native element truly cannot be used.

const { chromium } = require('playwright');
const AxeBuilder = require('@axe-core/playwright').default;

(async () => {
  const browser = await chromium.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com/checkout');

  const results = await new AxeBuilder({ page })
    .withTags(['wcag2a', 'wcag2aa'])
    .analyze();

  console.log(`Violations found: ${results.violations.length}`);
  results.violations.forEach(v => {
    console.log(`${v.id}: ${v.help} (${v.nodes.length} nodes)`);
  });

  await browser.close();
})();

A Playwright script that runs axe-core against a live page to catch WCAG A and AA violations automatically, which is a useful first pass before a manual NVDA, JAWS, or VoiceOver session.

Tips

  • Learn the core keyboard commands for NVDA and JAWS (heading, landmark, form field, and link navigation) before testing, so you can tell whether a bad announcement is a markup problem or a navigation mistake
  • Test with the screen reader's speech output on and the monitor off at least once per page, since this forces you to rely entirely on what is announced rather than unconsciously filling gaps with what you see
  • Keep a written script of navigation steps for each structured pass so results are comparable across NVDA, JAWS, VoiceOver, and TalkBack runs over time

Common pitfalls

  • Testing only with one screen reader and assuming the results generalize: NVDA, JAWS, and VoiceOver can announce the same markup differently, so a page that sounds fine in one can be confusing in another
  • Adding ARIA roles to fix an automated tool's warning without checking the resulting announcement in an actual screen reader, which can produce technically valid but confusing or redundant speech output

Building an Accessibility Testing Strategy and Reporting Findings

A one-off accessibility audit finds problems, but it does not keep a product accessible. A strategy is what turns a list of defects into a repeatable habit: a way to decide what to fix first, a way to write a report a developer can act on without asking follow-up questions, and a cadence that catches regressions before they reach users. This section pulls those three pieces together.

Start with triage. Not every violation deserves the same urgency: a missing alt attribute on a decorative icon is not the same problem as a login button with no accessible name. Sorting defects by severity and by how many users and which assistive technologies are blocked keeps the team working on what matters instead of what is easiest to fix.

Next comes the report itself. A report that says 'button is not accessible' sends a developer hunting. A report that names the rule violated, the expected behavior, what was actually observed, the exact element, and a screenshot gets fixed in one pass. Treat every accessibility finding as a bug report with evidence attached, not a checklist tick.

Finally, build a cadence. Accessibility testing that happens once before launch and never again drifts out of compliance as the product changes. Running automated checks on every build, and a fuller manual pass on a schedule, keeps the backlog from growing silently. xtest's Accessibility test agent checks the WCAG 2.0 through 2.2 A and AA rules with axe-core on the live page and then walks it by keyboard, and a suite built around it can run on a daily or weekly schedule so new violations show up the next morning instead of months later.

Prioritizing Defects by Severity and User Impact

Triage separates a true blocker from a minor annoyance so the team fixes the right things first. A practical three-tier model works for most teams:

  • Critical: the user cannot complete a core task at all. A form that cannot be submitted by keyboard, a modal that traps focus with no way out, or an image conveying essential information with no text alternative all fall here.
  • Major: the task is still possible but significantly harder. Confusing focus order, a missing landmark that forces a screen reader user to hunt through the whole page, or color contrast that fails the threshold on body text.
  • Minor: a real violation, but one with a workaround or limited impact, such as a redundant ARIA attribute or a slightly inaccurate heading level.

Severity alone is not enough: weigh it against reach. A defect on the checkout page affects every paying customer; the same defect on a rarely visited settings sub-page affects far fewer. A short, blocking defect on a high-traffic page should always outrank a longer list of minor defects on a page nobody uses.

It also helps to tag defects by which assistive technology surfaces them: keyboard-only, screen reader, screen magnification, voice control. A pattern of defects clustered around one technology points to a gap in how the team tests, not just a gap in the product.

Revisit triage as the backlog grows. A defect marked minor six months ago can become critical if a redesign makes it block a now-common user flow.

Writing Actionable Reports and Running a Recurring Cadence

A good accessibility bug report answers four questions without the reader having to ask: what rule or guideline was violated, what was expected, what was actually observed, and exactly where. Attach a screenshot and, where possible, the specific element or selector, so the fix can be verified against the same spot that failed.

A minimal but complete report looks like this:

Title: Submit button has no accessible name (WCAG 4.1.2)
Severity: Critical
Page: /checkout/payment
Expected: Button exposes a name a screen reader can announce, e.g. "Submit payment"
Observed: Button has no text content and no aria-label; screen reader announces "button"
Element: button.pay-now (no visible text, icon only)
Steps: Navigate to /checkout/payment, tab to the Submit button

That structure, consistently applied, means a developer can reproduce and fix the issue without a back-and-forth thread.

Cadence is what keeps these reports from piling up. Run automated checks on every pull request so regressions are caught before merge, and run a fuller manual pass, including keyboard and focus order checks, on a regular schedule rather than only before a release. A workspace using xtest can put an Accessibility suite on a daily or weekly schedule, and the next-morning email reports failures first with the test and step that broke, so a new violation is visible the day after it was introduced rather than discovered at the next audit.

const { test, expect } = require('@playwright/test');
const AxeBuilder = require('@axe-core/playwright').default;

test('checkout page has no critical accessibility violations', async ({ page }) => {
  await page.goto('https://example.com/checkout/payment');

  const results = await new AxeBuilder({ page })
    .withTags(['wcag2a', 'wcag2aa'])
    .analyze();

  const critical = results.violations.filter(v => v.impact === 'critical');
  expect(critical, JSON.stringify(critical, null, 2)).toEqual([]);
});

A Playwright test using axe-core to scan a page against WCAG 2.0 A and AA rules and fail the build if any critical violation is found, suitable for running on every pull request.

curl -X POST https://xtest.io/api/v1/findings/fnd_8217/fixed \
  -H "Authorization: Bearer xtest_live_XXXXXXXXXXXX" \
  -H "Content-Type: application/json"

A REST API call that marks a confirmed accessibility finding as fixed once the developer's change has shipped, keeping the Test Library's report in sync with the real state of the backlog.

Tips

  • Write every report as if the reader has never seen the page: name the rule, the expected result, the observed result, and the exact element, not just a general description.
  • Tag findings by assistive technology (keyboard, screen reader, magnification) so recurring patterns point to systemic gaps rather than isolated bugs.
  • Put automated accessibility checks on every pull request and reserve the fuller manual, keyboard-driven pass for a regular schedule rather than only before release.

Common pitfalls

  • Treating every violation as equal severity: a contrast issue on a footer link and a keyboard trap on a checkout form do not deserve the same priority, so triage by both rule severity and user reach.
  • Running accessibility checks only once before launch: without a recurring cadence, new code quietly reintroduces violations that nobody notices until the next full audit.

Exercises

Exercise 1: Run Your First Automated Accessibility Scan

In this exercise you will set up axe-core with Playwright and run an automated accessibility scan against a public webpage, then analyze the results to understand what kinds of issues automated tools can and cannot catch. This is the foundational skill for integrating accessibility checks into any testing workflow. You will install the required packages, write a script that navigates to a target page and runs the scan filtered to WCAG Level A and AA rules, and then review each violation reported, researching the specific success criterion it maps to. Finally, you will attempt to manually verify one of the reported violations by inspecting the page's HTML to confirm the automated tool's finding is accurate, since automated tools occasionally produce false positives that need human judgment to confirm.

  1. Install Node.js, Playwright, and the @axe-core/playwright package in a new project folder.
  2. Write a script that launches a browser, navigates to a public webpage of your choice, and runs an axe-core scan filtered to 'wcag2a' and 'wcag2aa' tags.
  3. Run the script and review the list of violations, noting the impact level (minor, moderate, serious, critical) of each.
  4. Pick three violations and look up their corresponding WCAG success criterion number and description.
  5. Open the page's developer tools and inspect the HTML element flagged by one violation to confirm the automated finding is accurate.

Expected outcome: A working script that produces a list of accessibility violations with their severity, success criterion mapping for at least three findings, and a manual confirmation that at least one reported violation is a real issue in the page's HTML.

Exercise 2: Keyboard-Only Navigation Audit

In this exercise you will unplug or disable your mouse and attempt to complete a common task on a website, such as filling out and submitting a contact form, using only your keyboard. This exercise builds the muscle memory and awareness needed to catch operability issues that automated scanners cannot detect, such as missing focus indicators, illogical tab order, and keyboard traps. You will document every point where you got stuck, could not tell where focus was, or could not reach an interactive element at all, and then map each issue to the relevant WCAG success criterion under the Operable principle.

  1. Choose a website with a multi-step form or a navigation menu with dropdowns.
  2. Disable your mouse or simply commit to not touching it for the duration of the test.
  3. Use Tab, Shift+Tab, Enter, Space, and arrow keys to navigate through the entire page, attempting to complete a realistic task like submitting a form.
  4. At every point where focus is unclear, unreachable, or trapped, write down the exact element and what went wrong.
  5. Map each issue found to a WCAG success criterion such as 2.1.1 (Keyboard), 2.1.2 (No Keyboard Trap), or 2.4.7 (Focus Visible).

Expected outcome: A written list of at least three keyboard accessibility issues, each mapped to a specific WCAG success criterion, along with a clear description of the user impact of each issue.

Exercise 3: Screen Reader Walkthrough of a Form

In this exercise you will use a free screen reader, such as NVDA on Windows or VoiceOver on macOS, to navigate and complete a web form without looking at the screen. This exercise is designed to build empathy and practical skill in recognizing how missing labels, poor heading structure, and unclear error messages affect a blind user's ability to complete a task. You will turn off your monitor or close your eyes during the walkthrough to simulate the experience as closely as possible, note every point of confusion, and then compare your findings against the page's HTML to identify the root cause of each issue, whether it is a missing label, an unassociated error message, or a heading structure that does not reflect the page's logical sections.

  1. Install and turn on NVDA (Windows) or enable VoiceOver (macOS) and learn the basic navigation commands (next heading, next form field, read current element).
  2. Navigate to a form-based website and turn off your monitor or close your eyes.
  3. Attempt to understand the page structure using only heading navigation commands.
  4. Attempt to fill out and submit the form using only the screen reader's form navigation commands, noting any field where the purpose was unclear.
  5. Deliberately submit the form with an invalid value and listen to whether the screen reader announces the resulting error message.
  6. Turn your monitor back on and inspect the HTML of any confusing field to identify whether a label, aria-label, or aria-describedby attribute was missing.

Expected outcome: A documented walkthrough noting at least two points of confusion, each traced back to a specific HTML or ARIA issue, and a confirmation of whether the form's error messages were announced correctly by the screen reader.

Quiz

1. What do the four letters in the WCAG principle acronym POUR stand for?

  1. Perceivable, Operable, Understandable, Robust
  2. Portable, Observable, Usable, Reliable
  3. Precise, Organized, Universal, Responsive
  4. Permanent, Open, Unified, Reviewed
Show answer

A. Perceivable, Operable, Understandable, Robust

POUR stands for Perceivable, Operable, Understandable, and Robust, the four foundational principles that organize all WCAG success criteria. Every testable success criterion falls under one of these four principles.

2. Which WCAG conformance level is most commonly targeted by organizations and referenced by legal accessibility requirements?

  1. Level A
  2. Level AA
  3. Level AAA
  4. Level AAAA
Show answer

B. Level AA

Level AA is the most commonly targeted conformance level because it provides meaningful accessibility while remaining practically achievable across most types of content. Level AAA includes criteria that are difficult or impossible to apply to all content, so it is usually used selectively rather than as a blanket target.

3. Why can't an automated accessibility scanner alone guarantee a page is fully accessible?

  1. Automated scanners only check for broken links, not accessibility
  2. Automated scanners cannot judge subjective or context-dependent issues like whether alt text is meaningful or whether a tab order is logical
  3. Automated scanners require a paid license to detect most issues
  4. Automated scanners only work on mobile apps, not websites
Show answer

B. Automated scanners cannot judge subjective or context-dependent issues like whether alt text is meaningful or whether a tab order is logical

Automated tools are good at catching objective, rule-based violations such as missing alt attributes or insufficient contrast ratios, but they cannot evaluate whether content actually makes sense to a human using assistive technology. Manual testing with a keyboard and a screen reader is needed to catch these contextual issues.

4. A user navigating a modal dialog with the keyboard finds that pressing Tab repeatedly cycles through the modal's fields but Escape and Shift+Tab never let them leave the modal. What accessibility problem does this describe?

  1. A missing alt text violation
  2. A color contrast violation
  3. A keyboard trap
  4. A missing page title
Show answer

C. A keyboard trap

This describes a keyboard trap, a violation of WCAG success criterion 2.1.2 (No Keyboard Trap), where a keyboard user becomes stuck inside a component with no way to move focus back out using standard keyboard commands.

5. Why is it generally recommended to use a native HTML element like <button> instead of a <div> with a click handler and ARIA attributes added to simulate a button?

  1. Native HTML elements render faster in all browsers
  2. Native HTML elements come with built-in keyboard operability, focus handling, and semantic roles that assistive technologies already understand, reducing the risk of incorrect ARIA implementation
  3. ARIA attributes are deprecated and no longer supported by any browser
  4. Divs cannot be styled with CSS, so buttons are required for visual design
Show answer

B. Native HTML elements come with built-in keyboard operability, focus handling, and semantic roles that assistive technologies already understand, reducing the risk of incorrect ARIA implementation

Native HTML elements like <button> already handle keyboard focus, keyboard activation (Enter and Space), and have a built-in semantic role that screen readers recognize automatically. Recreating this behavior with a <div> and ARIA attributes is error-prone and is why the first rule of ARIA use is to prefer native HTML whenever an element exists for the job.

Related docs

All courses