Using Axe DevTools for Web for Java
An overview of the testing integrations available for Java with Axe DevTools for Web
Not for use with personal data
Axe DevTools for Web offers four Java integrations. Each one adds accessibility scanning to an existing Java test suite, so which one you use depends on how your tests already drive the browser and how you prefer to assert results. All four run on JUnit, TestNG, or any other Java test runner.
Before writing tests, install and initialize the integration you need.
Choose an integration
- Selenium: scan pages from a Selenium WebDriver test. Start here if your suite already uses Selenium.
- Playwright: scan pages from a Playwright for Java test, using a chainable API.
- Hamcrest: assert accessibility with Hamcrest matchers, so failures report through the same mechanism as the rest of your matcher-based assertions.
- Cucumber: add accessibility steps to Cucumber feature files for behavior-driven test suites.
Selenium and Playwright are browser-driver integrations, and you pick one based on the driver your suite uses. Hamcrest and Cucumber are assertion and test-style integrations that layer on top of a driver.
Work with the results
- Use the results: every scan can return results as a JSON object, which you can assert against directly or process however your pipeline requires.
- Generate reports: produce shareable HTML accessibility reports from your scan results with the Axe DevTools reporter.
- Upload to Axe Developer Hub: send results to Axe Developer Hub to track accessibility over time and across builds.
For the full list of classes and methods each integration exposes, see the Java API reference.
