Handle Results

This page is not available in the language you requested. You have been redirected to the English version of the page.
Link to this page copied to clipboard
Not for use with personal data

Output

By default your accessibility results are available on the axe DevTools Mobile Dashboard. If you would like to analyze your results in your tests, the executeScript method has two potential outputs:

  1. A result object: Export a scan from the dashboard to see an example of the full JSON structure available to you.

    {
    "axeResultKey": {
        "packageName": "com.android.axe.sample.app",
        "resultId": "015968-b...",
        "userId": "676f94-a..." 
    },
    ...
    "axeRuleResults": [{
        "ruleSummary": "This view's accessibility path (or VoiceOver focus box) encapsulates its own visual on-screen frame.",
        "standard": "Best Practice",
        "status": "PASS",
        "props": {
            "accessibilityPath": {
                "right": 204,
                "bottom": 293,
                "top": 161,
                "left": 0
            },
            "className": "UIAccessibilityBackButtonElement",
            "isAccessibilityFocusable": true,
            "elementType": "button",
            "boundsInScreen": {
                "top": 161,
                "bottom": 293,
                "left": 0,
                "right": 204
            },
            "elementOffScreen": {
                "isOffScreen": false,
                "percentOffScreen": 0
            }
        },
        "isVisibleToUser": true,
        "ruleId": "A11yElementFocusBox",
        "axeViewId": "84926466349703185238156",
        "experimental": false,
        "impact": 1
    }...]
    ...
  2. An error object with a message:

    { "axeError": "User is not authenticated." }

Error Handling

The snippet below shows an example of error handling in JavaScript.

const result = await driver.execute('mobile: axeScan', settings)

if (result.axeError) {
console.log('error: ' + result.axeError)
} else {
console.log('no error')
// do results validation here
}