学习笔记1:appium 元素定位
appium元素定位
1. resource-id
ele = driver.find_element_by_id('xxx')
2.text
ele = driver.find_element_by_xpath('//*[@text="xxx"]')
3.content-desc
ele = driver.find_element_by_accessibility_id('xxx')
4.class
ele = driver.find_element_by_class_name('xxx')
uiautomator定位
1.text
loc_text = 'text("xxx")'
ele = driver.find_element_by_android_uiautomator(loc_text)
2.resourceId
loc_re = 'resourceId("xx")'
ele = driver.find_element_by_android_uiautomator(loc_re)
3.className
loc_class = 'className("xxx")'
ele = driver.find_element_by_android_uiautomator(loc_class)
4.description
loc_des = 'description("xxx")'
ele = driver.find_element_by_android_uiautomator(loc_des)