解决appium+微信小程序元素使用xpath无法定位

微信小程序中,使用driver.find_element_by_xpath定位元素报错no such element

self.driver.find_element_by_xpath("//*[@text='识别']").click()

但打印页面进行查看有找到元素

print(self.driver.page_source)

后面发现使用self.driver.find_element_by_android_uiautomator可定位成功,so这里记录下~

self.driver.find_element_by_android_uiautomator('text("识别")').click()