Text positioning:
Driver.find_element_by_android_uiautomator (' New Uiselector (). Text ("Please enter phone number")
#模糊定位
Driver.find_element_by_android_uiautomator (' New Uiselector (). Textcontains ("Please enter")
ResourceID positioning:
Driver.find_element_by_android_uiautomator (' New Uiselector (). ResourceId ("Cn.com.open.mooc:id/et_phone_edit")
ClassName Positioning:
Driver.find_element_by_android_uiautomator (' New Uiselector (). ClassName ("Android.widget.EditText")
Index positioning:
Driver.find_element_by_android_uiautomator (' New Uiselector (). Index (1) ')
ClassName + Index Method:
Driver.find_element_by_android_uiautomator (
' New Uiselector (). ClassName ("%s"). Childselector (New Uiselector (). Index ("%d"))
Pseudo-XPath method positioning:
#通过同级元素定位同级元素
Driver.find_element_by_android_uiautomator (' New Uiselector (). Text ("Custom View"). Fromparent (New Uiselector (). Text ("Accessibility Service")). Click ()
#通过父级元素定位子集元素
Driver.find_element_by_android_uiautomator (' New Uiselector (). ClassName ("Android.widget.ListView"). Childselector (New Uiselector (). Text ("Custom View")). Click ()
Android Uiautomator targeting in Appium python