Run a Scan
Ready, set, scan
When you initialize the Axe DevTools mobile library, you pass configuration settings into the axeStartSession method. This is where you declare your intent to upload results to Axe Developer Hub or to only save results locally.
// Once per test run
await driver.execute('mobile: axeStartSession', {
apiKey: "<DEQUE_APIKEY>",
projectId: "<DEQUE_PROJECT_ID>",
axeUploadResults: true
// Note: Results are uploaded to Axe Developer Hub by default;
// you can omit this value or set to `false` to only save results locally
});Activate the accessibility scan at any point in your tests. When you're ready to kick off an accessibility scan, call the Execute Script API, passing in axeScan.
// Per screen
driver.execute('mobile: axeScan')Input
| Param | Type | Description |
|---|---|---|
| axeSettings | Object |
Includes the authentication and configuration for Axe DevTools Mobile. (See Authentication Keys in Settings for required keys). |
Authentication Keys in Settings
If you have not initialized a session with the driver, you will need to provide one of the following in the axeSettings object to authenticate the scan.
| Key | Type | Description |
|---|---|---|
| apiKey | String |
Required by Deque to provide access to authorized users. Access your Axe DevTools Mobile API Key in the Axe Account portal. |
| licenseKey | String |
Required by Deque to provide access to authorized users for offline scans. Please reach out to your Deque representative or contact support to coordinate the delivery of your license key. |
Configuration Keys in Settings
If you wish to customize your testing configuration, you can add any of the optional keys below to the axeSettings object. Find more details about these properties - including deprecations - in Customize Your Configuration.
| Key | Type | Description |
|---|---|---|
| axeUploadResults | Boolean |
Set to false to authenticate without starting an Axe Developer Hub session, so results stay local. Defaults to true. |
| ignoreRules (deprecated) | [String] |
Provide an array of strings to apply a list of rules to ignore on all views. Each string in the array should be a valid ruleId - for example, ColorContrast. Find ruleIds inside of the axeConf object in the JSON result for any scan. Pass this value into mobile: axeScan call. |
| ignoreExperimental (deprecated) | Boolean |
When this parameter is set to true, experimental rule(s) will be ignored. The default value is false. Pass this value into the mobile: axeScan call. |
| uploadToDashboard (deprecated) | Boolean |
When this parameter is set to false, the scan will not be uploaded. The default value is true. Use axeUploadResults with mobile: axeStartSession instead. |
You may consider adding a utility function to your testing script as a central place to initiate an accessibility scan.
