DesktopAutomator class

Provides native UI automation on Linux and Windows desktop platforms.

On Windows, uses Microsoft UI Automation (COM/UIA). On Linux, uses AT-SPI2 (libatspi) for element discovery and xdotool for input synthesis.

Communication with the native side happens via a method channel (pl.leancode.patrol/desktopAutomator).

Constructors

DesktopAutomator({DesktopAutomatorConfig config = const DesktopAutomatorConfig()})
Creates a new DesktopAutomator.

Properties

config DesktopAutomatorConfig
The configuration for this automator.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

doubleTap({String? name, String? className, String? automationId}) Future<void>
Double-taps on the native UI element matching the given criteria.
enterText({required String text, String? name, String? className, int? index}) Future<void>
Enters text into the native UI element matching the given criteria.
findElement({String? name, String? className, String? automationId}) Future<Map<String, dynamic>?>
Finds a native UI element and returns its properties as a map.
findElements({String? name, String? className}) Future<List<Map<String, dynamic>>>
Finds all native UI elements matching the criteria.
initialize() Future<void>
Initializes the native automator.
isElementVisible({String? name, String? className, String? automationId}) Future<bool>
Returns whether a native UI element matching the criteria is visible.
markPatrolAppServiceReady() Future<void>
Signals that the PatrolAppService is ready.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pressKey(int keyCode, {bool shift = false, bool ctrl = false, bool alt = false}) Future<void>
Presses a key, optionally with modifier keys.
tap({String? name, String? className, String? automationId, int? index}) Future<void>
Taps on the native UI element matching the given criteria.
tapAt(double x, double y) Future<void>
Taps at the given screen coordinates.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

isSupported bool
Whether the current platform supports desktop automation.
no setter