axe DevTools Mobile integration with Appium
Prerequisites
-
Access to Digital.ai Continuous Testing
-
Application (APK / IPA) uploaded to the Application Manager
-
API Key for axe DevTools Mobile
-
Appium Tests running against Appium Version 2.11.3 or above
Digital.ai Continuous Testing integrates with axeDevTools for Mobile to help incorporate accessibility testing into your regular automation test workflows. Adding accessibility scans to your Appium Tests can help to capture important accessibility gaps within your applications. Let’s take a look at a simple Appium Test setup that would invoke accessibility scanning:
Axe drivers are supported from Appium version 2.16.2
For Android:
@BeforeMethod
public void setUp() throws MalformedURLException {
desiredCapabilities.setCapability("accessKey", ACCESS_KEY); // Digital.ai's Access Key
desiredCapabilities.setCapability("deviceQuery", "@os='android'");
desiredCapabilities.setCapability("appium:automationName", "AxeUiAutomator2");
desiredCapabilities.setCapability("app", "cloud:com.experitest.ExperiBank/.LoginActivity");
desiredCapabilities.setCapability("appPackage", "com.experitest.ExperiBank");
desiredCapabilities.setCapability("appActivity", ".LoginActivity");
desiredCapabilities.setCapability("appiumVersion", "2.16.2");
driver = new AndroidDriver(new URL("https://<your_cloud_url>/wd/hub"), desiredCapabilities);
Map<String, Object> settings = new HashMap<>();
List<String> tags = new ArrayList<>();
settings.put("apiKey", API_KEY); // axe DevTools API Key
settings.put("scanName", "Axe driver"); // a customized scan name to better identify scans within the dashboard.
settings.put("tags", tags); // an array of strings to apply to scans as tags.
driver.executeScript("mobile: axeScan", settings);
}
For iOS:
Supported from Cloud version 25.3
@BeforeMethod
public void setUp() throws MalformedURLException {
desiredCapabilities.setCapability("accessKey", ACCESS_KEY); // Digital.ai's Access Key
desiredCapabilities.setCapability("deviceQuery", "@os='ios'");
desiredCapabilities.setCapability("appium:automationName", "AxeXCUITest");
desiredCapabilities.setCapability("app", "cloud:com.experitest.ExperiBank");
desiredCapabilities.setCapability("bundleId", "com.experitest.ExperiBank");
desiredCapabilities.setCapability("appiumVersion", "2.16.2");
driver = new IOSDriver<>(new URL("https://<your_cloud_url>/wd/hub"), desiredCapabilities);
Map<String, Object> settings = new HashMap<>();
List<String> tags = new ArrayList<>();
settings.put("apiKey", API_KEY); // axe DevTools API Key
settings.put("scanName", "Axe driver"); // a customized scan name to better identify scans within the dashboard.
settings.put("tags", tags); // an array of strings to apply to scans as tags.
driver.executeScript("mobile: axeScan", settings);
}
While this example is in Java, we support multiple languages. To learn more, head to our Quick Start Projects page on GitHub.
To see the accessibility results, head to axe DevTools Mobile dashboard.
Help and Feedback
Help
If you didn’t find what you were looking for in our documentation and need help, reach out to our Support Team.
Feedback
If there are product ideas you’d like to submit for us to consider, head to our Ideas Space.