Automate

Automate

Make your phone or tablet smarter with automation

Get it on Google Play

Interact

A decision block that interacts with the on-screen user interface.

If the proceed option is set to Immediately, then the action will be performed on the UI elements currently visible on screen, without pausing the fiber. If set to When UI element appeared, then the fiber will pause until the UI element has appeared on screen.

Only use this block as a last resort if there’s no other way of performing the desired automation.

There are two types of interactions:

  • Global actions which can be performed at any time and doesn’t require knowledge of the on-screen UI elements, the proceed option is ignored.
  • Targeted actions which are performed on a specific Android UI element, custom graphics as used in games will likely not work. The UI element is selected by evaluating the XPath expression, if specified, otherwise it’s the currently focused UI element, if any. When passing text as string literal use the xpathEncode function to ensure proper quote character escaping. Use the Record interactions button to locate and generate the XPath expression of an UI element. The “context node” (.) is the entire UI layout document of the “active” window when using proceed Immediately, or an UI element that changed when using proceed When UI element appeared.

The NO path is executed if the action failed to be performed, or the UI element isn’t visible on screen when using proceed Immediately.

Use the App start or App in foreground block to ensure that the correct activity is shown on screen. A delay between sequential interactions may be needed to ensure the UI has been fully loaded and redrawn.

UI layout XML

The XML element “tag” name is the UI element view class. Attribute availability depends on type of UI element and Android version, see table below. Use the Inspect layout button to view the XML layout of a window shown on screen.

AttributeValueDescription
@android:checkablebooleanCan display a check mark
@android:checkedbooleanChecked state
@android:clickablebooleanReacts to clicks
@android:contentDescriptiontextAssociated content description
@android:contextClickablebooleanReacts to context clicks (Android 6+)
@android:editablebooleanHas an input method (Android 4.3+)
@android:enabledbooleanAllows interaction
@android:errortextError text (Android 5+)
@android:focusablebooleanCan take focus
@android:focusedbooleanCurrently has focus
@android:hinttextHint text (Android 8+)
@android:idtextIdentifier name (Android 4.3+)
@android:inputTypetextAllowed type of text input, separated by '|' (Android 4.4+)
@android:labelFortextIdentifier name of element it’s a label for (Android 4.3+)
@android:labeledBytextIdentifier name of label element (Android 4.3+)
@android:layout_height(number)Height
@android:layout_width(number)Width
@android:layout_x(number)Horizontal position on screen
@android:layout_y(number)Vertical position on screen
@android:longClickablebooleanReacts to long clicks
@android:maxLengthnumberMaximum length of text input (Android 5+)
@android:passwordbooleanInput characters displayed as password dots
@android:scrollablebooleanCan scroll
@android:selectedbooleanCurrently selected

Note! Interacting with Automate isn’t permitted, for security reasons. The Quick settings action may not work prior to Android 6. The Show input method picker action requires the “appear on top of other apps or parts of the screen” privilege on Android 9+.

Options

  • Proceed — when the fiber should proceed.
  • Record interaction — record new UI element interactions.
  • Recorded interactions — previously recorded interactions.

Input arguments

  • Action — action to perform, default Inspect.
  • Package — package name of the app displaying the UI, default is any.
  • XPath expressionXPath expression for selecting UI element to interact with, used for targeted actions, default is the focused UI element.
  • Content — generic content, used for the Set text and Focus next HTML element actions.

Output variables

  • Inspected content — variable to assign the text content of the inspected UI element.

Layout

  • Inspect layout — save the UI layout of a screen as an XML file, then view it.
Note! This documentation is also accessible within the app from Help & feedback menu.