Performing accessibility testing

We can perform basic accessibility checks by using tools such as Google's Accessibility Developer Tools (https://github.com/GoogleChrome/accessibility-developer-tools). We can inject the Google Accessibility testing library in a web page and perform the Accessibility Audit. This can be done automatically every time afterNavigatTo() is called. In the following code example, we will inject the axe_testing.js file provided by the Google Accessibility Developer Tools and perform the audit, which will print a report on the console:

public class IAmTheEventListener2 extends AbstractWebDriverEventListener {    @Override    public void beforeNavigateTo(String url, WebDriver driver) {        System.out.println("Before Navigate ...

Get Selenium WebDriver 3 Practical Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.