Accessibility + Testability FTW: Tech Tip
Accessibility + Testability FTW: Tech Tip Darrel Farris March 26, 2019
Accessibility + Testability FTW: Tech Tip
As the practice of testing as a squad activity continues to be encompass, testers and developer often collaborate on implementing custom & nbsp; impute or picker & nbsp; to improve resilience and maintainability in their automated tests, but can sometimes miss & nbsp; an chance to improve testabilityandaccessibility together & nbsp; without & nbsp; superfluous effort.
WAI-ARIAdescribes ways to make rich web coating more approachable to people with disabilities. HTML attributes are part of those recommendations and aria-label is a particularly interesting one because it bear the text that will be read aloud to a user & nbsp; via an assistive device such as a blind reader. In other words, & nbsp; aria-label attributes & nbsp; inform the UI & nbsp; a blind user hears.
Using custom & nbsp;data-attributes & nbsp; is a common exercise in front-end automation. Quite often, they bear some variety of metadata about the element — data that & nbsp; could & nbsp; instead be expressed as an aria-label property. The benefit to try automation is still there, but you get bonus points for & nbsp; best & nbsp; approachability, too.
Date pickers can & nbsp; challenging to automatize because your trial require to do things like “ click tomorrow ” or “ click two weeks from now ” rather than on specific date & nbsp; so they keep working day after day. Let 's take a looking & nbsp; at how & nbsp; an aria-label can be used for this function & nbsp; in an automated test.
Here are some great model of aria-label property from appointment pickers on three top traveling sites: & nbsp;
Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script.
aria-label= '' Choose Tuesday, March 26, 2019 as your check-in appointment. It 's available. ''aria-label= '' March 26 ''aria-label= '' March 26, 2019 ''
I wrote that makes working with these accessibility-aware & nbsp; date chooser hold leisurely. It retrovert a escortxdays from now that can be formatted or translated & nbsp; accord to a hope locale, e.g.March 26 & nbsp;or26. März 2019.
From there, it 's then & nbsp; easy to observe elements, or create affirmation in mabl & nbsp; using selectors & nbsp; as & nbsp; simple as[aria-label=] or [aria-label=]. & nbsp; These & nbsp; kind of dynamic variables make idealJavaScript snippets.
Now, it can be unwise & nbsp; to couple your tests to demonstration datum, like text, so & nbsp; consider & nbsp; your specific & nbsp; application and rest mindful of achieve stable constituent identifier. Since & nbsp; the calendar is unlikely to change anytime soon, it look a & nbsp; reasonable representative.
Next time impart & nbsp; custom attributes & nbsp; to an element for easygoing automation comes up, consider whether & nbsp; they might & nbsp; make full aria attributes. It could add a lot of value to the effort.
If you have & nbsp; other ideas or model & nbsp; of & nbsp; how testing and a11y improvements might & nbsp; enhance & nbsp; one another, please share in the comments!
Quality Engineering Resources
Automate This With SUSA
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.
Try SUSA FreeTest Your App Autonomously
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.
Try SUSA Free