Advanced Actions - google/android-uiconductor GitHub Wiki
Advanced Click Actions
Advanced click option is used to be more precise about the correct option to click. There are three kinds of options for selecting using the advance click actions. They are Resource Id, Text, and Xpath. Below is an illustration to use the Resource Id strategy.
The following examples are the syntax to click the date Resource Id, Text, and Xpath.
Resource ID Example
In this example we use resource id to click the date. It is good practice to use this, especially if there is no text visible for the source we want to click. Uicd will automatically find the resource id on the screen and click it.
com.google.android.apps.nexuslauncher:id/clock
Text Example
In this example we use text to click on Gmail. This is one of the multiple ways to use a click text action.
Gmail
XML Examples
In this example we want to click the second photo under "Thu, May 17, 2018". It is impossible just using text or the resource id. In this case XML will be very useful. Using XML is more dynamic compared to using resource id or text.
//*[@resource-id='com.google.android.apps.photos:id/photos_photogrid_date_scrubber_view']//*[@class='android.view.ViewGroup' and @index='12']
//*[@resource-id='com.google.android.apps.photos:id/photos_photogrid_date_scrubber_view']//androidviewViewGroup[@index='12']
Global Variable Validation Action
Global variable validation action is used with common java methods. In this example we have set $uicd_var = "Friday". Then we use the global variable validation action to see if $uicd_var contains "Friday".