Gestisci i risultati

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

Per impostazione predefinita, i risultati di accessibilità sono disponibili sulla axe DevTools Mobile Dashboard. Se desideri analizzare i risultati dei tuoi test, executeScript il metodo ha due potenziali output:

  1. Un oggetto risultato: Esporta una scansione dalla dashboard per visualizzare un esempio della struttura JSON completa a tua disposizione.

    {
    "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. Un oggetto di errore con un messaggio:

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

Gestione degli errori

Il frammento seguente mostra un esempio di gestione degli errori 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
}