Sparshi Dhiman

Sparshi Dhiman

Recent Posts

Automated Accessibility Testing with A11ym

Posted by Sparshi Dhiman on Jun 21, 2017 5:53:00 PM

The A11y Machine or a11ym (pronounced as ‘alym’) is an open-source automated accessibility tool for web applications which crawls and tests web pages against accessibility conformance standards to provide detailed reports.
 
A11ym validates the web pages against following accessibility standards:

Why Accessibility?

Accessibility is not just about helping disabled people. It’s about making the web more inclusive and enabling people around the globe with different abilities to access web content with greater ease. Accessible websites not only yield good SEO reports but also avoid potential lawsuits. Hence, making websites accessible is beneficial in every way.

Why A11ym?

One of our clients, a renowned insurance company in Australia, wanted to perform accessibility checks on their current site. Imagine the amount of manual effort in terms of time, resources, and money required to perform the accessibility run for a complete website! To overcome this challenge we decided to look for an appropriate automated tool, which brought us to a11ym. 
 
It had a couple of compelling features which sealed the deal for us -

  • Can run locally 
  • Can test private code 
  • Can test auth-required parts
  • Can crawl all web pages
  • Can test single URL as well as multiple URLs
  • Team can focus more on fixing the code rather than finding errors

A11ym Installation 

Pre-requisite:

  • Java ( to allow a11ym to validate web pages against the HTML5 recommendation)
  • Node Package Manager (NPM): Open terminal and run following command: $ npm install -g the-a11y-machine. A11ym will be installed in your machine in no time.

To ensure successful installation of a11ym, open terminal and run command: $a11ym

 
You will see options list for a11ym
image2_0

 
A11ym Usage: 

Let’s start with typing the base URLs of website

Hit command : $ ./a11ym http:/test.org/

All URLs accessible from http://test.org/ will be tested against the WCAG2AA (default accessibility standard defined in a11ym) standard. In order to reduce the number of URLs to test, --maximum-URLs option will be used.

For example: if the only URL needs to be tested use --maximum-URLs 1 or -m 1
 

Testing list of URLs

What if the client wants to perform accessibility check on business critical pages instead of crawling complete website? In order to achieve the same, multiple URLs can be provided in two ways -
 

  1. Compute several URLs by adding them to the command-line, like this: $ ./a11ym http://test.org/Ahttp://test.org/B http://test.org/C
  2. Read URLs from STDIN, as follows: $ cat URLs.lists | ./a11ym -

URLs.lists is the file containing a list of web pages. It can be of other extensions e.g. URLs.txt. When reading several URLs, the --maximum-depth option will be forced to 1 be the default.
 
Note the  -: It means “Read URLs from STDIN please”.
 
Standards (WCAG2A, WCAG2AA, WCAG2AAA) cannot be combined with each other, except HTML5 that can be combined with any other. 
 
So for instance, to run WCAG2AAA:
$ ./a11ym --standards WCAG2AAA http://test.org/
 
To run WCAG2AA along with HTML:
$ ./a11ym --standards WCAG2AA,HTML http://test.org/

How a11ym works?

Following are the intricacies of a11ym

  • The node-simple crawler tool is used to crawl a web application based on the given URLs
  • Two type of tests are performed on each URL.
  1. Accessibility: PhantomJS runs and HTML_CodeSniffer is injected in order to check the page conformance. This step is semi-automated by the help of pa11y, which is a very thin layer of code wrapping PhantomJS and HTML_CodeSniffer,
  2. HTML: The Nu Html Checker (v.Nu) is run on the URL to validate web page against HTML conformance.
  • Results from different tools are collected and produced

A11ym Reporting

“a11y_output” folder will be formed in the same directory from where the run was executed, once the test run is complete. 
To view complete report open a11ym_output/index.html residing in same folder.
 
Report of all URLs will look like this:
image1_0User can view detailed report of each URL separately by clicking on specific URL link.
image3_1

 
 A11ym report bifurcates all the issues in three categories i.e. error, warning, and notice. 
A CSS selector is provided with each reported issue to select and analyse the buggy element. In addition to it, description and a link to the W3C recommendation is also provided.
 For example:

  • Notice: This button element does not have a name available to an accessibility API. Valid names are: title attribute, element content
  • Code: H25,
  • Rule name: #WCAG2AA.Principle2.Guideline2_4.2_4_2.H25.2.
  • Selector: html>head>title
  • Code extract: <title>Career With Test - Scrum Mast...</title>

 
You can follow the GitHub link to download the a11ym project and explore it further.
 
If you work with QA and test automation, you can also explore our posts on Behat installation and mobile testing automation tools.

Topics: Accessibility, Framework and Libraries

The values I learnt at Srijan

Posted by Sparshi Dhiman on Feb 24, 2017 11:03:00 AM

Srijan, I believe, has always stood by its true meaning: 'creativity'.

Being a part of the family since the past 18 months, I have seen Srijan empowering its employees to always explore new horizons and learn great organisational values. I joined the organisation as a Quality Analyst with a decent set of skills. But who knew that there would be a plethora of opportunities in front of me, allowing me to discover all my talents.

It all started with the induction program with our CEO. I still remember his words when he said, and I paraphrase, “ Why do people say that they try to maintain work and life balance? Instead people should do their work so passionately so that it becomes their lives.” And he's one of the true living examples of that philosophy.

During my journey at , I've always been given complete liberty to express my views either about current process or any new ideas. We are not only encouraged to work upon the area of our interests, but also challenged to explore something new, as 'keep moving' is the real essence of agile.

It’s said that talent sometimes gathers dust, if not polished and carved out at the right time and with the right vision. Hence mentoring plays a vital role here. I am glad to be guided by some of the best agile leaders here, who not only strive to imbibe core concepts but also encourage us to maintain the momentum of learning.

In fact at , the old adage 'knowledge is power' has transformed to 'sharing is power'. When employees openly share their knowledge, the entire organization becomes more powerful. Learning under the right mentor-ship bagged me an opportunity to represent our agile work culture at a client site in Philippines. Our team was excited and had performed really well, and hence we were praised by the client numerous times on our technical capabilities.

But during our farewell lunch with the client team, they spoke about the organisational values and agile culture which team possessed. That is what they were seeking in a technology partner. He said, 'Hard skills can be found but value and culture is rare'. And that is when I realized that the organisational 'values' are what builds trust within any professional relationship and becomes the stepping stone for any mutually cordial relationship.

Another organisational value that Srijan holds dear is the social responsibility to give back to our society and community which has given us so much. Srijan fosters the culture of participation in meetups and forums. We are not only motivated to volunteer for community contributions, but are also guided throughout whenever and where-ever needed. It is always ensured that the everyone's notions are listened to and taken into account at all times. And I feel active involvement in talks, sharing the ideas, listening and imbibing others' opinions are the small steps to achieve quality at work.

I feel lucky to be surrounded by great people and leaders who believe in motivating others to lead as well.

Topics: Life at Srijan

Discussion

Write to us

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms Of Service apply. By submitting this form, you agree to our Privacy Policy.

See how our uniquely collaborative work style, can help you redesign your business.

Contact us