Search code examples
iphoneiosinstrumentsios-ui-automation

What are UIAElements and their subclasses, like UIAScrollview and UIAWebview?


I've seen this UIAElement class referred to in places, but I can't find much documentation on it.

Is this something generated by Interface Builder? For example, if I drag a UIWebView into Interface Builder, does it create a corresponding UIAWebView?


Solution

  • The "A" in the prefix for these items stands for automation (or possibly accessibility). These are JavaScript classes used within scripts for the UI Automation tool. The full list of them can be found in the UI Automation Reference Collection.

    They roughly correspond to the user interface elements you will be testing within your UI Automation scripts. For example, you command a UIAWindow class to do something in your script, and it may drive a corresponding UIWindow instance in your application.

    These elements key off of accessibility information you provide for your interface, so it's also worth reading the Accessibility Programming Guide for iOS.

    You can refer to the WWDC 2010 video session 306 - Automating User Interface Testing with Instruments, or the testing session of my class on iTunes U for more on how all of this works.

    So no, they're not generated by Interface Builder, they manage something else.