Auto Scan
Automatically identify accessibility issues as your existing UI tests interact with your app
Overview
Auto Scan automatically identifies accessibility issues as your existing Espresso or UIAutomator tests interact with your app, without the need to add individual scan calls or modifications to your tests. Auto Scan listens for screen changes and scans each unique screen automatically.
If you need more granular control in your tests, see Targeted Testing.
How it works
Our Gradle plugin will replace your JUnit instrumentation runner with our custom runner. This allows us to observe your test suite and process your results at the appropriate time. Get the AxeDevToolsMobile Gradle plugin.
When the test finishes, Auto Scan processes your results and saves a JSON result for each screen as well as a self-contained HTML report to AxeDevToolsMobileResults, and optionally uploads results to Developer Hub.
Getting Started
-
A few values need to be set to configure and authenticate users. We recommend adding these as environment variables on your computer and on your CI/CD pipelines to keep your keys secure.
Groovy (
build.gradle):axeDevTools { axeMobileApiKey = '' axeAutoScanMode = true axeProjectId = '' }Kotlin DSL (
build.gradle.kts):axeDevTools { axeMobileApiKey = "" axeAutoScanMode = true axeProjectId = "" } -
If you are using our tools and prefer to get results in offline mode, you will set a value for the
axeOfflineLicenseKeyin lieu ofaxeMobileApiKeyandaxeProjectId.Groovy (
build.gradle):axeDevTools { axeOfflineLicenseKey = '' axeAutoScanMode = true }Kotlin DSL (
build.gradle.kts):axeDevTools { axeOfflineLicenseKey = "" axeAutoScanMode = true }
Interpreting Results
Console Summary
Once the test suite finishes, you can see some post-processing in your Gradle logs, followed by a summary.
HTML rule report written to: /Users/user/Documents/workspace/android/project-name/app/build/reports/AxeDevToolsMobileResults/AxeDevToolsMobile_1773882427726.html
---- Axe DevTools Mobile Accessibility Summary ----
Scan 1:
Screen: Home Page
Issues: 6
Issues by rule:
- TouchSizeWcag: 3
- LabelAtFront: 1
- LabelInName: 1
- FocusableText: 1
Scan 35:
Screen: Wikipedia Alpha
Issues: 5
Issues by rule:
- LabelAtFront: 1
- LabelInName: 1
- TouchTargetSpacing: 1
- TouchSizeWcag: 1
- ColorContrast: 1
Total Scans: 35
❌ Total Issues: 123
---------------------------------------------------Output Files
Auto Scan generates a self-contained HTML report with screenshots, view hierarchy data, and detailed issue information. Individual JSON results are saved to the axe-test-data directory. All files are saved to the app/build/reports/AxeDevToolsMobileResults directory.
| File | Format |
|---|---|
AxeDevToolsReport.html |
Interactive HTML report with per-screen issues, element details, impact levels, view hierarchy |
<timestamp>-axe-node-hierarchy.json |
Individual JSON result - 1 for each scan taken |
Auto Scan Support
Rules
Auto Scan runs the full Axe rule set with the exception of ScreenOrientation and all experimental rules (e.g. NestedActiveControl, NestedElementName, InaccessibleAction). Find detailed information about what we check for in the Rule Overview for Android.
Developer Hub
Auto Scan automatically uploads your results to Axe Developer Hub. If you only want to save results locally, set axeUploadResults to false.
Configuration Reference
Properties
| Property | Type | Required | Details |
|---|---|---|---|
axeAutoScanMode |
Boolean | Required | Defaults to false. Must set to true to enable auto scan. |
axeUploadResults |
Boolean | Optional | Defaults to true. Set to false for local results only |
axeMobileApiKey |
String | Optional | An Axe DevTools Mobile API key from axe.deque.com is required if axeUploadResults=true |
axeProjectId |
String | Optional | A Project ID from Developer Hub is required if axeUploadResults=true |
axeServerUrl |
String | Optional | Custom backend URL, for on-prem/private cloud only |
axeOfflineLicenseKey |
String | Optional | Only required for offline mode, when axeUploadResults=false |
Best Practices
Disable Animations
Get the most accurate and comprehensive results from Auto Scan by disabling animation. This will ensure screens are fully rendered when captured. If animations are not disabled, you may notice:
- Duplicate scans that you believe should have been dropped
- Scans with screenshots showing a transitory state
- A significantly lower screen capture rate than you might be expecting
Troubleshooting
If you are not seeing scans show up in Developer Hub, you should check your logs for hints of what might be wrong or go through this checklist.
- Check that
axeAutoScanMode=truein youraxeDevToolsconfiguration block - Verify that you were able to get our dependency from the Gradle Plugin Portal
- Make sure you are using the correct variable for your API/License Key and Project ID
- Check the size of your output files. The upload to Developer Hub fails if the size of any one result file is greater than 20MB, though all the results are still saved locally and shown in the local HTML report.
What's Next?
You can view your results in Axe Developer Hub. Learn how to integrate Axe DevTools Mobile in your CI/CD pipeline. Using a cloud-based testing platform? You can still use Axe DevTools Mobile to look for accessibility issues: Integrate with Cloud Platforms.
