See Also: UiAutomation
public sealed class UiAutomation : Object
Class for interacting with the device's UI by simulation user actions and introspection of the screen content. It relies on the platform accessibility APIs to introspect the screen and to perform some actions on the remote view tree. It also allows injecting of arbitrary raw input events simulating user interaction with keyboards and touch devices. One can think of a UiAutomation as a special type of AccessibilityService which does not provide hooks for the service life cycle and exposes other APIs that are useful for UI test automation.
The APIs exposed by this class are low-level to maximize flexibility when developing UI test automation tools and libraries. Generally, a UiAutomation client should be using a higher-level library or implement high-level functions. For example, performing a tap on the screen requires construction and injecting of a touch down and up events which have to be delivered to the system by a call to UiAutomation.InjectInputEvent(InputEvent,Boolean).
The APIs exposed by this class operate across applications enabling a client to write tests that cover use cases spanning over multiple applications. For example, going to the settings application to change a setting and then interacting with another application whose behavior depends on that setting.
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 18
The members of Android.App.UiAutomation are listed below.
See Also: Object
|RotationFreeze0||UiAutomationRotation (0). Rotation constant: Freeze rotation to 0 degrees (natural orientation)|
|RotationFreeze180||UiAutomationRotation (2). Rotation constant: Freeze rotation to 180 degrees .|
|RotationFreeze270||UiAutomationRotation (3). Rotation constant: Freeze rotation to 270 degrees .|
|RotationFreeze90||UiAutomationRotation (1). Rotation constant: Freeze rotation to 90 degrees .|
|RotationFreezeCurrent||UiAutomationRotation (-1). Rotation constant: Freeze rotation to its current state.|
|RotationUnfreeze||UiAutomationRotation (-2). Rotation constant: Unfreeze rotation (rotating the device changes its rotation state).|
|[read-only]||RootInActiveWindow||AccessibilityNodeInfo. Gets the root AccessibilityNodeInfo in the active window.|
|ServiceInfo||AccessibilityServiceInfo. Gets the an AccessibilityServiceInfo describing this UiAutomation.|
|[read-only]||WindowAnimationFrameStats||WindowAnimationFrameStats. Gets the window animation frame statistics.|
|[read-only]||Windows||IList<Android.Views.Accessibility.AccessibilityWindowInfo>. Gets the windows on the screen.|
Clears the window animation rendering statistics.
Clears the frame statistics for the content of a given window.
|ExecuteAndWaitForEvent(IRunnable, UiAutomation+IAccessibilityEventFilter, Int64)|
Executes a command and waits for a specific accessibility event up to a given wait timeout.
Executes a shell command.
Find the view that has the specified focus type.
Gets the frame statistics for a given window.
A method for injecting an arbitrary input event.
Performs a global action.
Sets a callback for observing the stream of AccessibilityEvents.
Sets the device rotation.
Sets whether this UiAutomation to run in a "monkey" mode.
Takes a screenshot.
Waits for the accessibility event stream to become idle, which is not to have received an accessibility event within idleTimeoutMillis.