UI Browser vs. Apple's Accessibility Inspector
Apple has long offered its free utility Accessibility Inspector—formerly known as UI Element Inspector—as one of the developer tools associated with Xcode. Apple released the latest version, Accessibility Inspector 5, with Xcode 8 when it released macOS v10.12 Sierra on September 20, 2016. Xcode is available as a free download on the Mac App Store, and Accessibility Inspector is located inside the Xcode application package. Accessibility Inspector can be launched from Xcode by choosing Xcode > Open Developer Tool > Accessibility Inspector. Accessibility Inspector can also be used without launching Xcode, for example, by adding it to the Dock.
Accessibility Inspector 5 is significantly improved over previous versions, with expanded capabilities and an attractive new user interface. In some respects it has caught up with UI Browser in terms of its coverage of the accessibility API and its ability to inspect and manipulate the UI element hierarchy of other running applications. It still remains primarily a screen reader, however, focused on the UI element currently under the cursor, whereas UI Browser is both a screen reader and a more Finder-like browser that lets you view and control the overall UI element hierarchy as well as individual UI elements.
One area in which UI Browser still provides essential features that are not available at all in Accessibility Inspector is AppleScript and its GUI Scripting technology. Only UI Browser helps you to explore, test and perform GUI Scripting on the Mac. With UI Browser, you can view the AppleScript terms that reference UI elements and their attributes, actions and notifications in the context of a target application's UI element hierarchy. UI Browser also generates working GUI Scripting AppleScript statements for you, placing them automatically in any standard AppleScript editor you choose. UI Browser even provides the AppleScript index numbers of UI elements in the hierarchy—something that Accessibility Inspector cannot do—so that your scripts can use the index reference form when you prefer it over the name reference form or when UI element names are unavailable.
GUI Scripting enables AppleScript scripts to read and manipulate the graphical user interface objects of any standard Mac application. It relies on the Processes Suite of Apple's System Events application to exercise the AppleScript terminology that can control other applications even if they are not scriptable themselves. System Events is based on the same accessibility API that UI Browser and Apple's Accessibility Inspector use. UI Browser surpasses Accessibility Inspector, however, by making use of both the System Events Processes Suite and the accessibility API. UI Browser encompasses a much broader range of functionality than Accessibility Inspector, which is strictly a tool for exploring the accessibility API.
If Apple's Accessibility Inspector does everything you need, by all means use it. But if you are a scripter, you will find that UI Browser covers both aspects of the GUI Scripting experience—GUI Scripting terminology and the UI element hierarchy—in a single tool. Even if your use case is focused solely on the accessibility API, you should consider UI Browser, because GUI Scripting is itself a useful tool for testing any application's accessibility implementation. UI Browser will help you to add GUI Scripting to your suite of automated testing tools.
How are the two applications different?
Short Answer #1: UI Browser is like the Finder itself: it is primarily a browser that displays the entire hierarchy of elements, using a familiar multi-column browser view so you can browse from element to element and see parents, children and their siblings up and down the currently selected hierarchy all at once. Accessibility Inspector remains more like the Finder's Get Info window: it is primarily a screen reader that displays information about a single User Interface element at a time, namely, the one currently under the mouse. Accessibility Inspector does show the currently selected UI element hierarchy, but only in a collapsible outline view; UI Browser shows you an outline view and the more comprehensive browser view that gives the utility its name. Accessibility Inspector 5 improves the ability to move quickly up and down the hierarchy by clicking an arrow, but it does not show the parents, the children and their siblings at all levels simultaneously as in a browser. Both utilities offer additional drawers or windows to display additional information about any UI element.
Short Answer #2: UI Browser includes a Screen Reader with enhanced features, giving you the best of both worlds. Click UI Browser's Switch to Screen Reader button, and a screen reader window fades in while the other UI Browser windows fade out to get out of the Screen Reader's way. Click the Screen Reader's Auto Motive mode button, and the window turns semi-transparent and automatically moves out of the way when you move the mouse over a target application's UI element on the screen. Command-click the Screen Reader's Find in Browser button, and UI Browser's main browser window fades back into view, with the UI element that was under the mouse selected and ready for you to explore. You can set a variety of preferences to refine the Screen Reader's behavior to suit your working habits. Accessibility Inspector 5 improves the usability of the feature that lets you toggle the screen reader functionality off in order to observe a specific UI element even while moving the cursor, and it adds a very useful new capability to limit the active screen reader functionality to a single target application at a time.
Short Answer #3: UI Browser offers many features that don't exist at all in Accessibility Inspector. For example, UI Browser generates GUI Scripting script statements for you based on your selection of an element and an attribute or action. While Accessibility Inspector 5 has a Notifications window that lists notifications as they are posted, it does not show both the notifying and affected UI elements and it does not navigate back to them in the main window for you. UI Browser lets you try out different parameter values in parameterized attributes. In Accessibility Inspector's favor, it includes Accessibility Verifier, which was once a separate application; UI Browser does not have that capability.
Short Answer #4: Try them both and see for yourself!
Long Answer: Here are several features that are unique to UI Browser.
- Browse any application's user interface in UI Browser's browser view without switching to the target application and without navigating its actual user interface on the screen.
- Use hot keys to get information about the UI element under the mouse without opening the screen reader, optionally bringing UI Browser to the front.
- Switch to an enhanced Screen Reader to see all of the actions, attributes, and notifications supported by the UI element currently under the mouse, in real time as you move the mouse around on the screen, and then switch back to the browser view for still more information about the element under the cursor and to browse additional elements.
- View the selected element's AppleScript name and index number as part of a simplified outline of the target application's containment hierarchy.
- Register for live notifications from target applications or their specific user interface elements and, when notifications are posted in real time as the target application changes state, see the posting and affected elements and switch back to the browser view to examine them with the push of a button.
- Use specially designed tools to set modifiable properties of a target application's user interface elements from within UI Browser, and optionally receive real-time notifications when they take effect. For example, text areas in a target application can be edited within a large UI Browser text window with the full power of Mac OS X text editing, including a split window, cut and paste, drag and drop, and undo/redo.
- Send keystrokes with virtual modifier keys, for example, to execute the target application's menu items using keyboard shortcuts, and optionally receive real-time notifications when they take effect.
- Use any of UI Browser's windows either as globally floating palettes so they are always available while working with a target application, or as normal windows so that nothing in the target application is hidden when it's brought to the front. Switch between the floating and normal states on the fly by clicking a button.
- View and print a formatted report listing the selected element's path and all of its actions, attributes, and notifications at once to help you write more complicated scripts.
- See "mismatch" warnings in both the browser and the screen reader when UI Browser discovers that a target application's UI element hierarchy is not identical in both directions. Mismatches are a common bug in many applications, and they can interfere with GUI Scripting or VoiceOver functionality.
- Saving the best for last: generate AppleScript script statements, with options to put them on the clipboard or send them directly to AppleScript Editor, Script Debugger, or Smile for editing and execution.
This page was first published by PFiddlesoft on May 25, 2010. Last updated September 20, 2016.
Copyright © 2003-2016 Bill Cheeseman. Used by permission. All Rights Reserved.
PFiddlesoft, PFiddle Software, Pfiddle, Pfiddles, and the PFiddlesoft logo are trademarks of PreForm Assistive Technologies, LLC.