Deque axe™ Integration
Deque's axe™ is one of the world's leading digital accessibility toolkits. The axe-core library provided by Deque allows you to inject functionality into your tests in order to scan content and return an a11y score.
Below is a guide to set up the Sauce Labs integration. This integration allows you to run your accessibility tests on our platform with axe™.
Check out the Deque Accessibility Guide for further information.
What You'll Need
- A Sauce Labs account (Log in or sign up for a free trial license)
 - A Deque Account (Optional)
 
Sauce Labs UI
The full page report gives an easy to consume overview of all the acessibility results with stats and extended details:
Language Specific Examples
- Java
 - JavaScript
 - Python
 - Ruby
 - C#
 
pom.xml:<!-- https://mvnrepository.com/artifact/com.deque.html.axe-core/selenium -->
<dependency>
  <groupId>com.deque.html.axe-core</groupId>
  <artifactId>selenium</artifactId>
  <version>4.2.2</version>
</dependency>
new AxeBuilder().analyze(driver);
loading...
- 
Install and Set up WebdriverIO.
This documentation shows you how to run a test locally, and also how to troubleshoot potential issues with your code before running on Sauce Labs.
 - 
Add Sauce Service to WebdriverIO.
 - 
Add the following dependency to your
package.jsonfile: 
"@axe-core/webdriverio": "4.2.1"
- In the 
wdio.conf.jsfile, create an object calledaxeWdio. This object creates a newAxeWebdriverIOinstance which accepts the current browser object from WDIO as an argument. 
before: function (capabilities, specs, browser) {
    const axeWdio = new AxeWebdriverIO({
        client: browser
    })
}
- In the 
wdio.conf.jsfile, add a command for getting basic accessibility results. 
browser.addCommand('getAxeResults', function (name) {
return axeWdio.analyze()
})
browser.getAxeResults()
sa11y library directly:Requirements- Install Sa11y.
 
pip install sa11y
- Import the 
Analyzeclass in your file. 
from sa11y.analyze import Analyze
Analyze(driver).results()
loading...
sa11y library directly:Requirements- Add 
sa11yto yourgemfile: 
gem 'sa11y', '~> 0.2.1'
- Require the 
Analyzeclass in your file: 
require 'sa11y/analyze'
Sa11y::Analyze.new(driver).results
loading...
- Install via NuGet, in the Package Manager Console.
 
Install-Package Selenium.Axe
- Import the namespace.
 
using Selenium.Axe;
AxeResult axeResult = new AxeBuilder(webDriver).Analyze();
Additional Resources
- Deque Sauce Labs Integration Documentation
 - Deque axe DevTools Mobile - for Native Mobile App Testing On Real Devices
 - Deque 
axe-coreSelenium Integration for Java - Sa11y - Selenium Accessibility for Python & Ruby
 - Deque 
axe-coreExample WebdriverIO Project - Documentation about the chainable 
axeAPI for WebdriverIO - Selenium.Axe for .NET