Appium Testing on Perfecto

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

Run accessibility testing on mobile applications with Appium, now supported on Perfecto!

Not for use with personal data

Deque has partnered with Perfecto to bring accessibility testing to your existing automation test workflows. Add accessibility scans to your Appium tests with axe DevTools Mobile, run your tests on Perfecto devices, then review the results in our online axe DevTools Mobile Dashboard.

Prerequisites:

How to Take Accessibility Scans

Perfecto has pre-installed the axe Appium drivers on their Appium servers. These drivers enable you to run accessibility scans from your Appium tests. Deque's AxeUiAutomator2 and AxeXCUITest drivers are forked from the UiAutomator2 and XCUITest drivers. We fork but do not change the core functionality of these drivers. Your tests will run as expected, and you'll have the added capability to take accessibility scans!

The key steps to configure your Appium tests for accessibility testing are:

  1. Set the Automation Name to AxeUiAutomator2 for Android or AxeXCUITest for iOS. (Note the Axe prefix.)
  2. Provide your Deque API key for authentication.
  3. Execute the script mobile: axeScan each place in your tests you'd like to take an accessibility scan.
  4. After running your tests on Perfecto devices, review your results on the axe DevTools Mobile dashboard.

Refer to our setup guide for Appium to learn how to customize your configuration and leverage results of accessibility scans to best serve your team, and see a full list of Appium sample tests. The setup guide and examples are general and do not contain everything you need for the Digital.ai integration.

Examples

Refer to the code below to configure your Appium tests for accessibility testing with the Perfecto platform and run accessibility scans.

Enable our drivers, configuring the automationName capability based on the platform:

Android Configuration

The automationName should be set to AxeUiAutomator2. The appPackage value is the package name of the Android app under test.

{ 
  "automationName": "AxeUiAutomator2", // Note the 'Axe' prefix.
  "appPackage": "<your-app-package>" 
}

iOS Configuration

The automationName should be set to AxeXCUITest. The bundleId value is the bundle identifier of the iOS app under test.

{ 
  "automationName": "AxeXCUITest",  // Note the 'Axe' prefix.
  "bundleId": "<your-app-bundle-id>" 
}

Scan for Accessibility

Appium supports multiple programming languages. The JavaScript snippet below shows capabilities required for axe DevTools Mobile being added to test scripts - namely, your axe DevTools Mobile API key. You can create a custom name for your scans for better traceability. Trigger an accessibility scan using the mobile: axeScan command.

const axeSettings = { 
  apiKey: '<your-api-key-here>', // axe DevTools Mobile API key
  scanName: '<your-scan-name-here>' // Optional: Customize the scan name
  tags: ['tag-one', 'tag-two'] // Optional: Add tags, to more easily find and group scans
}; 

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