結果の処理
Not for use with personal data
出力
アクセシビリティの結果は axe Developer Hubで利用可能です。テストで結果を分析したい場合、 executeScript メソッドには2つの可能な出力があります。
-
結果オブジェクト: ダッシュボードからスキャンをエクスポート して、利用可能な完全なJSON構造の例を確認してください。
{ "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 }...] ... -
メッセージを含むエラーオブジェクト:
{ "axeError": "User is not authenticated." }
エラーハンドリング
以下のスニペットは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
}