解决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()

 

posted @ 2020-10-10 14:28  spellbound  阅读(1053)  评论(0编辑  收藏  举报