Skip to content

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).

Notifications You must be signed in to change notification settings

mvsaran/Accessibility-Testing-Axe-Selenium-Java-

Repository files navigation

✔ Accessibility Scanner — Axe + Selenium (Java)

📖 Short Project Description

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).

💡 Why accessibility testing matters

✔ 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 💰.

🛠 Tools & Dependencies

  • ☕ 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)

📂 Project layout (recommended)

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

🚀 Step-by-step setup & run guide

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)

4️⃣ Implement the tests

  • AllyTest.java → launches Chrome, navigates, waits, runs AXE, writes AllyTest.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.

⚙ Suggested TestNG hook (auto report generation)

@AfterSuite(alwaysRun = true)
public void generateReports() {
    AccessibilityReportGenerator generator = new AccessibilityReportGenerator();
    generator.generateReports("AllyTest.json");
}

🛡 Triage & next steps

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.

🤖 CI Integration suggestions

  • 📦 Archive AccessibilityReport.html + AccessibilityReport.csv as build artifacts.
  • 🚨 Fail build if > threshold of violations.
  • 🔔 Integrate with Slack/Jira.

📚 References

📝 Notes & best practices

  • Run axe after dynamic content loads ⏳.
  • Automated tool ⚡ + manual testing 👨‍🦯 recommended.
  • Use JSON for automation, HTML/CSV for humans.

👤 Author

Saran Kumar

About

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).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published