AxeRunner is used to run accessibility tests on web pages using the axe-core library. It integrates with Selenium WebDriver to automate web accessibility testing, providing detailed reports on accessibility violations, passes, and other relevant results. The resulting axe-core report is converted into Java classes so that it can be used within a Java project.
- Runs accessibility tests on specified URLs.
- Uses Selenium WebDriver for browser automation.
- Configurable via
AxeSpec
andAxeRunOptions
. - Parses and categorizes accessibility test results.
- Supports axe-core rule customization.
- Supports axe-core localization.
- Java (JDK 8 or higher)
- Selenium WebDriver
To use AxeRunner
, include the following dependencies in your project:
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.x.x</version>
</dependency>
<dependency>
<groupId>ie.briandouglas</groupId>
<artifactId>axe_runner</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
WebDriver driver = new ChromeDriver(); // or any other WebDriver instance
AxeRunner axeRunner = new AxeRunner(driver);
String url = "https://example.com";
AxeResults results = axeRunner.getAxeResults(url);
AxeSpec spec = new AxeSpec(); // Define accessibility testing specifications
AxeRunOptions options = new AxeRunOptions(); // Define run options
AxeResults results = axeRunner.getAxeResults(url, spec, options);
System.out.println("Violations: " + results.violations.size());
System.out.println("Passes: " + results.passes.size());
- If
axe-core.min.js
fails to load, an exception is thrown. - If Selenium fails to navigate to the page, the WebDriver is closed.
- JSON processing errors during configuration are logged.
This project is licensed under the Apache License, Version 2.0.
- Fork the repository.
- Create a feature branch.
- Submit a pull request.
For any inquiries or support, reach out to Brian Douglas.