Skip to main content

JUnit 5

Use this guide when your Selenium tests use JUnit 5 (Jupiter). Accessibility is still driven entirely by grid capabilities and the lambda-accessibility-scan hook (or auto-scan), identical to the Selenium Accessibility Automation flow—only the test lifecycle annotations differ.

Browsers: Use Chrome or Edge with supported versions for Accessibility Automation.

Prerequisites

  • TestMu AI credentials as environment variables (guide)
  • JUnit 5 on the classpath (junit-jupiter-api, etc.) driving Selenium
  • Accessibility enabled for your account

Onboarding path

1. Centralize driver creation

Use @BeforeEach or @BeforeAll (with a static WebDriver if you share one per class) to build MutableCapabilities / ChromeOptions once. Every test method should inherit the same Accessibility flags.

2. Enable Accessibility on the session

capabilities.setCapability("accessibility", true);
capabilities.setCapability("accessibility.wcagVersion", "wcag21aa"); // optional

See Configure Accessibility Automation for all flags.

3. Trigger scans

Hook after stable UI:

driver.executeScript("lambda-accessibility-scan");

Or auto-scan every navigation:

capabilities.setCapability("accessibility.autoscan", true);

4. Run and verify

mvn test

Open the Automation Dashboard → session → Accessibility tab.

5. Scale to the full suite

Add @Tag("a11y") or parallel config if you want selective Accessibility runs in CI; keep capability setup shared so behavior stays consistent.

Troubleshooting

SymptomWhat to check
No reportaccessibility: true plus hook or accessibility.autoscan.
Multiple scans on one testYou called the hook more than once; reduce to one stable checkpoint per logical page.

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles