Information Technology Reference
In-Depth Information
The Automation instrument is only available on iOS. For OS X, Instruments includes a simple UI recorder that can
capture and replay user actions.
Setting up objects to support automation
The UI automation system doesn't use outlets or links. Objects are referenced in two ways:
Views can be accessed through the application's view tree. With the correct code, views “just work.”
UI elements must be modified in IB.
To include an object in testing, select in IB and modify it as listed here and shown at the right of Figure 16.29:
Make sure the Accessibility box is checked. (For many objects, Accessibility is on by default.)
Give the object a unique name in its Label field.
The figure shows a very simple example with a single text field. A real UI is likely to have a longer list of UI ele-
ments, and you must repeat both steps for all of them.
FIGURE 16.29
Setting up a UI object to support test automation
CAUTION
Don't enable accessibility for container views. If you do, automation can't find the UI elements inside them.
Search WWH ::




Custom Search