appnium+python没法定位元素的问题

问题

最近在作微信公众号爬虫的项目,在弄微信手机app自动化的时候发现,当咱们使用'uiautomator'定位到某些元素后,指定相应的xpath,会发现程序提示没法定位元素微信

解决方法

上诉问题出现的缘由颇有多是咱们手工找的xpath不正确。能够考虑用'uiautomator2'来定位并获取程序的xpathapp

uiautomator和uiautomator2界面对比

1. uiautomator:

定位“订阅号消息”,uiautomator没有给出xpath 测试

2. uiautomator2:

一样定位“订阅号消息”,uiautomator2给出了xpathui

3. uiautomator2安装教程:

这里参考CSDN文章:使用uiautomator2自动化测试app(一)------安装篇.net

相关文章
相关标签/搜索