Getting Started
Quickly identify accessibility issues in your Android application.
The axe DevTools for Android SDK integrates seamlessly into your existing UI Tests with Espresso, UIAutomator or Appium. We provide all the data for your team so that you can enable the processes that work for you. Want to ensure there are no critical issues before enabling a pull request to be merged? You can do that. Wanna generate a scoped report of the accessibility issues of a automated test run on a branch, maybe a release candidate branch? You can do that. We even have an optimized automation variant for a more robust test run without network dependencies.
Results sent to the dashboard can be viewed in the axe DevTools Mobile dashboard.
Sample Application
Download our sample application on GitHub. Add your Deque credentials and follow the README to begin scanning. This application is inaccessible to showcase axe DevTools Mobile's implementation steps and accessibility issue detection.
Setup
Requires:
- Android API 24 or higher
- Username and Password for the axe DevTools Mobile Dashboard
Import The Library
Using Maven Central
Inside the project's build.gradle file add mavenCentral
to the repositories list. This may be within the buildscript
block or the allprojects
block.
buildscript {
repositories {
mavenCentral()
}
}
or
allprojects {
repositories {
mavenCentral()
}
}
Using Artifactory
View the instructions for using Artifactory.
Implementation
In the application build.gradle file, add:
androidTestImplementation 'com.deque.android:axe-devtools-android:5.1.0'
and
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
//For Espresso Tests:
exclude 'META-INF/AL2.0'
exclude 'META-INF/LGPL2.1'
}
}
also, make sure there is Internet permission in the AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
Working Example
Below is a complete sample application build.gradle file.
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
dataBinding {
enabled = true
}
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 22
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
//For Espresso Tests:
exclude 'META-INF/AL2.0'
exclude 'META-INF/LGPL2.1'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation 'com.deque.android:axe-devtools-android:5.1.0
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Next, Setup Your Automated Tests
Set up your automated tests to scan for accessibility issues. Select the guide that best suits your needs:
- For XML, Compose, or React Native: Setup for Layout Agnostic Testing
- Setup for XML Layout Testing
- Setup for Compose Layout Testing