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
Sauce Labs will display the accessibility results in our UI as a tab in the job itself:

Language Specific Examples
- Java
- JavaScript
- Python
- Ruby
- C#
We highly recommend using the Java Sauce Bindings. Check out the description and examples for the new Accessibility functionality.
The following is information on how to use the Java Deque Axe Selenium library directly:
Requirements
Add the following to your 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>
Usage
This method populates results on the Sauce Labs Accessibility tab:
new AxeBuilder().analyze(driver);
Example Code
loading...
Requirements
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.json
file:
"@axe-core/webdriverio": "4.2.1"
- In the
wdio.conf.js
file, create an object calledaxeWdio
. This object creates a newAxeWebdriverIO
instance 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.js
file, add a command for getting basic accessibility results.
browser.addCommand('getAxeResults', function (name) {
return axeWdio.analyze()
})
Usage
This method populates results on the Sauce Labs Accessibility tab:
browser.getAxeResults()
We highly recommend using the Python Sauce Bindings. Check out the description and examples for the new Accessibility functionality.
The following is information on how to use the Python sa11y
library directly:
Requirements
- Install Sa11y.
pip install sa11y
- Import the
Analyze
class in your file.
from sa11y.analyze import Analyze
Usage
This method populates results on the Sauce Labs Accessibility tab:
Analyze(driver).results()
Example Code
loading...
We highly recommend using the Ruby Sauce Bindings. Check out the description and examples for the new Accessibility functionality.
The following is information on how to use the Ruby sa11y
library directly:
Requirements
- Add
sa11y
to yourgemfile
:
gem 'sa11y', '~> 0.2.1'
- Require the
Analyze
class in your file:
require 'sa11y/analyze'
Usage
This method populates results on the Sauce Labs Accessibility tab:
Sa11y::Analyze.new(driver).results
Example Code
loading...
To get accessibility results with C# and .NET, we recommend using Selenium.Axe for .NET, version 3.0 or higher.
Requirements
- Install via NuGet, in the Package Manager Console.
Install-Package Selenium.Axe
- Import the namespace.
using Selenium.Axe;
Usage
This method populates results on the Sauce Labs Accessibility tab:
AxeResult axeResult = new AxeBuilder(webDriver).Analyze();
For more detailed usage, see Selenium.Axe for .NET.
Additional Resources
- Deque Sauce Labs Integration Documentation
- Deque axe DevTools Mobile - for Native Mobile App Testing On Real Devices
- Sauce Bindings Accessibility Feature
- Deque
axe-core
Selenium Integration for Java - Sa11y - Selenium Accessibility for Python & Ruby
- Deque
axe-core
Example WebdriverIO Project - Documentation about the chainable
axe
API for WebdriverIO - Selenium.Axe for .NET