AndroidAutomator class abstract interface

Provides functionality to interact with the OS that the app under test is running on.

Communicates over http with the native automation server running on the target device.

Properties

hashCode int
The hash code for this object.
no setterinherited
resolvedAppId String
Returns the platform-dependent unique identifier of the app under test.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

allowPermission() Future<void>
Taps the standard Android system dialog "Allow" button.
closeNotifications() Future<void>
Closes the notification shade.
inherited
configure() Future<void>
Configures the native automator.
inherited
denyPermission() Future<void>
Denies the permission that the currently visible native permission request dialog is asking for.
inherited
disableAirplaneMode() Future<void>
Enables airplane mode.
inherited
disableBluetooth() Future<void>
Disables bluetooth.
inherited
disableCellular() Future<void>
Disables cellular (aka mobile data connection).
inherited
disableDarkMode({String? appId}) Future<void>
Disables dark mode.
inherited
disableLocation() Future<void>
Disables location.
disableWifi() Future<void>
Disables Wi-Fi.
inherited
doubleTap(AndroidSelector selector, {Duration? timeout, Duration? delayBetweenTaps}) Future<void>
Double taps on the native view specified by selector.
enableAirplaneMode() Future<void>
Enables airplane mode.
inherited
enableBluetooth() Future<void>
Enables bluetooth.
inherited
enableCellular() Future<void>
Enables cellular (aka mobile data connection).
inherited
enableDarkMode({String? appId}) Future<void>
Enables dark mode.
inherited
enableLocation() Future<void>
Enables location.
enableWifi() Future<void>
Enables Wi-Fi.
inherited
enterText(AndroidSelector selector, {required String text, KeyboardBehavior? keyboardBehavior, Duration? timeout, Offset? tapLocation}) Future<void>
Enters text to the native view specified by selector.
enterTextByIndex(String text, {required int index, KeyboardBehavior? keyboardBehavior, Duration? timeout, Offset? tapLocation}) Future<void>
Enters text to the index-th visible text field.
getFirstNotification() Future<Notification>
Returns the first, topmost visible notification.
inherited
getNativeViews(AndroidSelector? selector) Future<AndroidGetNativeViewsResponse>
Returns a list of currently visible native UI controls, specified by selector, which are currently visible on screen.
getNotifications() Future<List<Notification>>
Returns notifications that are visible in the notification shade.
inherited
getOsVersion() Future<int>
Gets the OS version.
inherited
grantPermissionOnlyThisTime() Future<void>
Grants the permission that the currently visible native permission request dialog is asking for.
inherited
grantPermissionWhenInUse() Future<void>
Grants the permission that the currently visible native permission request dialog is asking for.
inherited
initialize() Future<void>
Initializes the native automator.
isPermissionDialogVisible({Duration timeout = const Duration(seconds: 1)}) Future<bool>
Waits until a native permission request dialog becomes visible within timeout.
inherited
isVirtualDevice() Future<bool>
Checks if the app is running on a virtual device (simulator or emulator).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openApp({String? appId}) Future<void>
Opens the app specified by appId. If appId is null, then the app under test is started (using resolvedAppId).
inherited
openNotifications() Future<void>
Opens the notification shade.
inherited
openPlatformApp({required Object androidAppId}) Future<void>
Opens a platform-specific app.
openQuickSettings() Future<void>
Opens the quick settings shade on Android and Control Center on iOS.
inherited
openUrl(String url) Future<void>
Opens the URL specified by url.
inherited
pickImageFromGallery({AndroidSelector? imageSelector, int? index, Duration? timeout}) Future<void>
Pick an image from the gallery
pickMultipleImagesFromGallery({required List<int> imageIndexes, AndroidSelector? imageSelector, Duration? timeout}) Future<void>
Pick multiple images from the gallery
pressBack() Future<void>
Presses the back button.
pressDoubleRecentApps() Future<void>
Double presses the recent apps button.
pressHome() Future<void>
Presses the home button.
inherited
pressRecentApps() Future<void>
Presses the recent apps button.
inherited
pressVolumeDown() Future<void>
Press volume down
inherited
pressVolumeUp() Future<void>
Press volume up
inherited
pullToRefresh({Offset from = const Offset(0.5, 0.5), Offset to = const Offset(0.5, 0.9), int steps = 50}) Future<void>
Simulates pull-to-refresh gesture.
selectCoarseLocation() Future<void>
Select the "coarse location" (aka "approximate") setting on the currently visible native permission request dialog.
inherited
selectFineLocation() Future<void>
Select the "fine location" (aka "precise") setting on the currently visible native permission request dialog.
inherited
setMockLocation(double latitude, double longitude, {String? packageName}) Future<void>
Set mock location
inherited
stopMockLocation() Future<void>
Stop mock location
inherited
swipe({required Offset from, required Offset to, int steps = 12, bool enablePatrolLog = true}) Future<void>
Swipes from from to to.
swipeBack({double dy = 0.5}) Future<void>
Mimics the swipe back (left to right) gesture.
takeCameraPhoto({AndroidSelector? shutterButtonSelector, AndroidSelector? doneButtonSelector, Duration? timeout}) Future<void>
Take and confirm the photo
tap(AndroidSelector selector, {Duration? timeout}) Future<void>
Taps on the native view specified by selector.
tapAt(Offset location) Future<void>
Taps at a given location.
tapOnNotificationByIndex(int index, {Duration? timeout}) Future<void>
Searches for the index-th visible notification and taps on it.
tapOnNotificationBySelector(AndroidSelector selector, {Duration? timeout}) Future<void>
Taps on the visible notification using selector.
toString() String
A string representation of this object.
inherited
waitUntilVisible(AndroidSelector selector, {Duration? timeout}) Future<void>
Waits until the native view specified by selector becomes visible. It waits for the view to become visible for timeout duration. If timeout is not specified, it utilizes the AndroidAutomatorConfig.findTimeout.

Operators

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