by

How to Use Pa11y for Automated Accessibility Testing of Web Pages, Part 1

Screen Shot 2014-03-24 at 7.31.07 AM

Here at ProfHacker, we’ve covered accessibility (often abbreviated as a11y) in a number of different posts. This is an ever-growing topic of interest for many, but especially for those who design and maintain websites and want to ensure they can give access to all types of users, including those with disabilities. However, the most common question that I hear is, “How do I make sure that my site is accessible?” The best way to check for accessibility is still user testing, but if you’re just making sure that you haven’t broken something since the last round of user testing — or if you’re testing your personal site — then an automated test can be of great help.

One of the newest, and easiest ways to test for accessibility is to use a freely available and open source tool called Pa11y (available at Pa11y.org). This tool runs on Macs and Linux, and will also run on Windows with a bit of coaxing. Pa11y is a command line tool that provides a minimalistic interface for testing.

You can find the installation instructions on the Pa11y-CLI GitHub page for Mac and Linux, and tips for getting it running on Windows. The installation is rather involved if you are not familiar with the Terminal on the Mac, and even then it requires installation of Apple Developer Tools. To make the process easier, I’ve created an up-to-date installation guide and made it available as a GoogleDoc.

Once you’ve successfully installed the software, to test your sites you just have to remember a single simple command. To begin testing a page, type the following command into your Terminal application (on the Mac found in /Applications/Utilities):

pa11y domain.com

Replace domain.com in the above command with the URL of the page you wish to test on your site. When you press “enter,” Pa11y will go to work, firing off, downloading, and then parsing the HTML on the page in question to see how it compares with Section508 requirements as well as other accessibility standards.

Items that are highlighted green are suggestions, orange are things that could possibly be wrong and should be checked into, and red items are things are wrong with your site and should be fixed for optimum accessibility.

What about you? Do you use an automated accessibility testing tool to ensure that your site maintains accessibility for your users? Let us know in the comments below.

Return to Top