Whether you’re designing a new application or access enabling an existing one, you should plan to test the accessibility of your product. Testing for accessibility is a bit different than standard user-interface testing and Apple provides a couple of tools that make the process easier.
Application developers should read this chapter to find out how to exercise the accessibility of their applications.
In Mac OS X v10.4 and later, Apple provides the Accessibility Inspector testing tool in /Developer/Applications/Utilities/Accessibility Tools
. You can download the Developer Tools from the Apple Developer Connection website (developer.apple.com). Accessibility Inspector presents a utility window that displays the attributes (and values), actions, and position in the accessibility hierarchy of the object currently under the mouse pointer. To use Accessibility Inspector, be sure to enable assistive applications in the Universal Access Preferences.
If you’re beginning to access-enable your application, try using Accessibility Inspector to view the accessibility information other applications provide. Although Accessibility Inspector is not an assistive application, it uses the same APIs assistive applications use to get information from the accessibility objects it encounters.
You can focus Accessibility Inspector on a specific object to examine its attributes, perform its actions, and access its parent and children (if any), by pressing Command-F7. When you do this, the Accessibility Inspector display freezes, allowing you to move the mouse without changing the object on which the tool is focused. A second utility window then appears that displays information about the selected object. In this second window, you can go to the object’s parent, children, or other related objects, such as the containing window or the top-level accessibility object. You can also perform the actions supported by this accessibility object, allowing you to see how this affects the values of various attributes and the application itself.
As you access-enable your application, use Accessibility Inspector to make sure your objects contain the appropriate information. If you find that a specific object is not accessible, you can focus Accessibility Inspector on that object and examine its attribute values and perform its actions to find the problem.
In Mac OS X v10.4 and later, Apple provides the Accessibility Verifier tool in /Developer/Applications/Utilities/Accessibility Tools
. Accessibility Verifier displays the accessibility hierarchy comprising all currently instantiated objects in the selected application. To use Accessibility Verifier, be sure to enable assistive applications in the Universal Access Preferences.
Use Accessibility Verifier to perform any or all of the following tests (select the tests you want to run by clicking the Choose Tests... button):
Parent/Child. This test checks the integrity of the accessibility hierarchy by making sure each parent-child pair forms a closed loop. For example, if a child listed in a parent object’s children attribute does not refer to that object as its parent, this parent-child pair is invalid. Invalid parent-child pairs can prevent an assistive application from correctly traversing an application’s accessibility hierarchy.
Window. This test checks that all objects contained in a window include attributes that refer to the containing window. An object contained in a window is not necessarily the child of that window, but it should refer to its containing window as a convenience for assistive applications.
Missing AXDescription. This test checks for the presence of the description attribute in accessibility objects that require one. Recall from “The Description Attribute” that all accessibility objects must provide some context-specific descriptive information to assistive applications. If an object does not display a descriptive title, it should include the description attribute and an appropriate value.
Role Verification. This test verifies that an accessibility object’s attributes are appropriate for its role. See “Roles and Associated Attributes” for more information on the attributes that are associated with each role.
When you click Verify, Accessibility Verifier runs the tests you selected and displays the results for each. The problems are reported as warnings or errors, depending on their severity (you can filter the results by selecting a severity level in the Report Level pop-up menu).
It’s important to note that eliminating all errors and warnings Accessibility Verifier displays does not guarantee a perfectly accessible application. You should always test your application with various assistive applications to make sure there are no problems.
Last updated: 2008-03-11