This project scans a target website (example: 🌐 https://www.irctc.com/) for accessibility issues using Deque's ♿ axe-core library integrated with Selenium WebDriver (Java).
📝 The test run produces a machine-readable JSON result (AllyTest.json
).
📊 A separate post-processing utility converts that JSON into human-friendly reports (CSV 📑 and HTML 🌐) suitable for stakeholders and defect tracking systems (Jira/Excel).
✔ Ensures your product is usable by people with disabilities (👓 visual, 🖐 motor, 🧠 cognitive, 👂 hearing).
✔ Reduces ⚖ legal and compliance risk (WCAG conformance helps meet accessibility laws/regulations).
✔ Improves overall UX 😀 and SEO 🔍 (better-structured pages are easier to parse and navigate).
✔ Catches issues early in the CI/CD pipeline ⚙ (shift-left approach) so fixes are cheaper 💰.
- ☕ Java (JDK 11+ recommended; project uses Java 17+ or Java 21 depending on your environment)
- 📦 Maven (build & dependency management)
- 🌐 Selenium WebDriver (
selenium-java
) - ♿ Deque
axe-selenium-java
(axe-core + Java bindings) - 🔧 WebDriverManager (
io.github.bonigarcia
) — automatic driver management - 📜 org.json (JSON parsing)
- ✅ TestNG (test runner) — or JUnit if preferred
- ⚡ Optional: Maven Exec Plugin, CI tools (Jenkins/GitHub Actions/GitLab CI)
AccessibilityTesting/
┣ 📂 src/main/resources/
┃ ┗ 📜 axe.min.js ← axe-core JavaScript file (required by axe-selenium-java)
┣ 📂 src/test/java/AccessibilityTests/
┃ ┣ 📜 AllyTest.java ← TestNG test: runs axe scan and writes AllyTest.json
┃ ┗ 📜 AccessibilityReportGenerator.java ← Post-processor: AllyTest.json → CSV + HTML
┣ 📜 AllyTest.json ← generated by the test run
┣ 📜 AccessibilityReport.csv ← generated by the generator
┣ 📜 AccessibilityReport.html ← generated by the generator
┣ 📜 pom.xml
1️⃣ Prerequisites
- Install ☕ JDK (11+). Verify:
java -version
- Install 📦 Maven. Verify:
mvn -v
- Import as Maven project in IDE (Eclipse/IntelliJ).
2️⃣ Add axe.min.js
- Place in
src/main/resources/
(copy from official repo).
3️⃣ Add dependencies (pom.xml
)
- Include:
axe-selenium-java
,selenium-java
,webdrivermanager
,json
,testng
. - 📌 Example snippet: see https://github.com/dequelabs/axe-selenium-java
4️⃣ Implement the tests
AllyTest.java
→ launches Chrome, navigates, waits, runs AXE, writesAllyTest.json
.AccessibilityReportGenerator.java
→ converts JSON → CSV + HTML.
5️⃣ Run the tests
- ▶ Run in IDE: TestNG test class.
- ▶ Or CLI:
mvn test
6️⃣ Generate reports
- Manual: Run
AccessibilityReportGenerator
. - Auto: Integrate with @AfterSuite/@AfterMethod(alwaysRun=true).
7️⃣ Outputs & sharing
- 📊 CSV → Jira/Excel evidence.
- 🌐 HTML → browser-friendly report.
- 📝 JSON → source of truth for automation.
@AfterSuite(alwaysRun = true)
public void generateReports() {
AccessibilityReportGenerator generator = new AccessibilityReportGenerator();
generator.generateReports("AllyTest.json");
}
1️⃣ Prioritize by impact (critical 🔴, serious 🟠, moderate 🟡, minor 🟢).
2️⃣ Share element selectors + 📎 helpUrls.
3️⃣ Re-run tests after fixes 🔄.
4️⃣ Add accessibility smoke-suite in CI.
- 📦 Archive
AccessibilityReport.html
+AccessibilityReport.csv
as build artifacts. - 🚨 Fail build if > threshold of violations.
- 🔔 Integrate with Slack/Jira.
- 📌 Official repo: https://github.com/dequelabs/axe-selenium-java
- ♿ Axe rules: https://dequeuniversity.com/rules/axe
- 🌐 WCAG overview: https://www.w3.org/WAI/standards-guidelines/wcag/
- Run axe after dynamic content loads ⏳.
- Automated tool ⚡ + manual testing 👨🦯 recommended.
- Use JSON for automation, HTML/CSV for humans.
Saran Kumar