The goal of this tutorial is to help you understand the process of testing and validating Accessible Rich Internet Applications (ARIA) implementations. ARIA provides a way to make web content and web applications more accessible to people with disabilities.
By the end of this tutorial, you should be able to:
Basic understanding of HTML, CSS, JavaScript, and ARIA standards is required. Some familiarity with web accessibility principles would be helpful.
ARIA stands for Accessible Rich Internet Applications. It's a set of attributes that help enhance the accessibility and interoperability of web content and applications.
There are numerous tools available for testing ARIA implementations:
Validation ensures that your ARIA roles, states, and properties are used correctly. You can use the ARIA Validator extension for this purpose.
<!-- This is a simple HTML structure with ARIA attributes -->
<div role="main" aria-labelledby="welcome">
<h1 id="welcome">Welcome to our website!</h1>
<p>We hope you find it accessible and easy to use.</p>
</div>
To test this with AXE:
axe-core
npm package.axe.run
function on your HTML.var axe = require('axe-core');
var html = '...'; // your HTML
axe.run(html, function(err, results) {
console.log(results.violations);
});
For validation, you can use the ARIA Validator extension for Chrome.
In this tutorial, we've explored the importance of ARIA compliance, discussed various testing tools like AXE and WAVE, and learned how to validate our ARIA implementations with the ARIA Validator extension.
Create a simple web page with ARIA attributes and test it using AXE.
Add some incorrect ARIA roles, states, and properties to your page from Exercise 1. Use the ARIA Validator to identify the errors.
Here's a simple web page:
<div role="main" aria-labelledby="welcome">
<h1 id="welcome">Hello, World!</h1>
</div>
Testing with AXE should yield no violations.
Adding incorrect ARIA attributes:
<div role="main" aria-labelledby="nonexistent">
<h1 id="welcome">Hello, World!</h1>
</div>
ARIA Validator will show an error because aria-labelledby
refers to an id that doesn't exist.