A decision block that allows inspection of the on-screen user interface layout.
If the proceed option is set to Immediately, then UI layout is evaluated for the currently “active” window without pausing the fiber. If set to When UI layout changed, then the fiber will pause until the UI layout has changed and evaluation produced a result.
The XPath expression, if specified, is used to evaluate the UI layout, e.g. to select a particular UI element and/or extract a attribute of it. When passing text as string literal use the xpathEncode function to ensure proper quote character escaping. The “context node” (.) is the entire UI layout document of the “active” window when using proceed Immediately, or the UI element that changed when using proceed When UI layout changed.
The YES path is executed when the evaluated result is a a Number, a String, a Boolean true, a selected Node or a nonempty Node-set. The NO path for a Boolean false, or when using proceed Immediately, not selected a Node or an empty Node-set.
The 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.
|boolean||Can display a check mark|
|boolean||Reacts to clicks|
|text||Associated content description|
|boolean||Reacts to context clicks (Android 6+)|
|boolean||Has an input method (Android 4.3+)|
|text||Error text (Android 5+)|
|boolean||Can take focus|
|boolean||Currently has focus|
|text||Hint text (Android 8+)|
|text||Identifier name (Android 4.3+)|
|text||Allowed type of text input, separated by '|' (Android 4.4+)|
|text||Identifier name of element it’s a label for (Android 4.3+)|
|text||Identifier name of label element (Android 4.3+)|
|(number)||Horizontal position on screen|
|(number)||Vertical position on screen|
|boolean||Reacts to long clicks|
|number||Maximum length of text input (Android 5+)|
|boolean||Input characters displayed as password dots|
Note! The XML of a layout can be very large, avoid using result type Node and Node-set that selects entire elements, to then parse and process them using blocks/functions, instead let the XPath do most of the “processing” to limit the result to a Boolean or the value of a specific attribute.