Image Blog Mobile Application Acessibility Testing
May 29, 2018

How to Do Mobile Accessibility Testing

Automation

Mobile applications need to be accessible to everyone. To accomplish this, you need mobile accessibility testing.

What Is Mobile Accessibility Testing?

Accessibility testing means testing mobile applications to ensure they can be used by everyone — including people with disabilities such as hearing or color blindness. 

Why Mobile Accessibility Testing Is Important

Accessibility testing is important to creating a good user experience. It ensures that everyone is treated equal. This is widely acknowledged to be a top priority — including by Apple CEO Tim Cook

“We’ve always viewed accessibility as a human right, and just like human rights are for everyone, we want our products to be accessible to everyone.”

—Tim Cook, Apple CEO

What to Check in Mobile Accessibility Testing

Websites frequently have been targets of disability discrimination. The W3C WAI accessibility standards/guidelines cover what to check in web accessibility testing. This includes:

  • Perceivable information in the UI.
  • Operable information in the UI. 
  • Understandable information in the UI.
  • Robust content.

Using test automation frameworks (such as Selenium and Appium) can help in web accessibility testing, too. 

This trend of disability discrimination is making its way into the domain of mobile applications.

Most aspects of mobile accessibility are covered in existing W3C WAI accessibility standards/guidelines. At this time, however, there are no separate guidelines for mobile accessibility. The W3C is developing updated requirements and more specific guidance regarding this important issue.

How to Perform Mobile Accessibility Testing

Here's how to perform mobile accessibility testing using instrumented tests (Espresso Android and XCUITest).

Using Espresso for Android Accessibility Testing

Espresso users can use their existing tests to run and validate accessibility issues. With a few minor changes, the same test artifacts can help developers find these types of issues early in the process.

The AccessibilityCheck class runs accessibility checks automatically before any interaction with a View. Just import the class and add the following code to your setup methods annotated with @Before:

[javascript]
import android.support.test.espresso.contrib.AccessibilityChecks;

@RunWith(AndroidJUnit4.class)

@LargeTest

public class AccessibilityChecksIntegrationTest {

@BeforeClass

public static void enableAccessibilityChecks() {

AccessibilityChecks.enable();

}

}

[/javascript]

Android also has some additional documentation for accessibility testing

Using GTXiLib With XCUITest For iOS Accessibility Testing

iOS developers can take advantage of Google’s GTXiLib, an open source accessibility test automation framework. GTXiLib is based on the XCTest unit testing framework. You can install GTXiLib for any of your test classes and register a number of accessibility checks to be performed along with your unit tests. If any accessibility check fails, the corresponding unit test will also fail.

To install GTXiLib for one of your test classes, just add the following line of code to its +setup method:

[javascript]

+ (void)setUp {

[super setUp];

// ... your other setup code (if any) comes here.

// Install GTX on all tests in *this* test class.

[GTXiLib installOnTestSuite:[GTXTestSuite suiteWithAllTestsInClass:self]

checks:[GTXChecksCollection allGTXChecks]

elementBlacklists:@[]];

}[/javascript]

Using this method, all accessibility checks will be run for each of the unit tests defined in that test class.

You can get more GTXiLib tips and info on GitHub.

 

[Related Content: Mobile Testing Basics]

 

Leverage Accessibility Testing Automation

Ensuring a great user experience for everyone doesn’t have to be a chore. The tools we’ve talked about here will help get your testing strategy on the right track. Accessibility is something all companies and developers should be thinking about. It’s just the right thing to do.

“We don’t make products for a particular group of people; we make products for everybody.  We feel very strongly that everyone deserves an equal opportunity and equal access.”

—Tim Cook, Apple CEO

Make Mobile Accessibility Testing Easier With Automation

Perfecto makes it easy to leverage accessibility testing automation.

Perfecto has advanced support for Espresso and XCUITest. This allows users to combine the power of these test assets with the cloud. Our support for these frameworks enables development teams to retain the advantages discussed above, while adding the security, flexibility, and robustness of Perfecto’s cloud-based platform.

See for yourself how Perfecto makes mobile accessibility testing easier. You can get started right now with a free trial. 

Try Perfecto