UIAApplication Class Reference

Overview

The UIAApplication class allows access to, and control of, app-level user interface elements.

For an explanation of how to use this and related classes, see “Automating UI Testing” in Instruments User Guide.

Tasks

Working With App-level Elements

Methods

actionSheet

Returns the action sheet.

(UIAActionSheet) actionSheet()

alert

Returns the alert.

(UIAAlert) alert()

bundleID

Returns a string containing the app’s bundle ID in reverse-DNS format.

(String) bundleID()

editingMenu

Returns the app’s edit menu.

(UIAEditingMenu) editingMenu()

interfaceOrientation

Returns the interface orientation.

(Number) interfaceOrientation()
Discussion

Interface orientation represents the rotation required to keep the interface right-side up upon device rotation. Note that in landscape mode, device orientation and interface orientation are opposite, because rotating the device requires rotating the content in the opposite direction.

keyboard

Returns the app’s keyboard.

(UIAKeyboard) keyboard()

mainWindow

Returns the object that represents the app’s main window.

(UIAWindow) mainWindow()

navigationBar

Returns the app’s navigation bar.

(UIANavigationBar) navigationBar())

preferencesValueForKey

Gets the value of a specified app user preference.

(NotTyped) preferencesValueForKey(key)
Parameters
key

The key representing the preference to be set.

setPreferencesValueForKey

Sets the value of a specified app user preference.

(undefined) setPreferencesValueForKey(NotTyped value, String key)
Parameters
value

The new value to set for the specified preference.

key

The key representing the preference to be set.

statusBar

Returns the app’s status bar.

(UIAStatusBar) statusBar()

tabBar

Returns the app’s tab bar.

(UIATabBar) tabBar()

toolbar

Returns the app’s toolbar.

(UIAToolbar) toolbar()

version

Returns a string representing the build version number of the app.

(String) version()
Discussion

The build version is represented by a string comprising three period-separated integers.

windows

Returns an array of objects representing the app’s windows.

(UIAElementArray) windows()