- 前言
- 个人观点觉得uiautomator2的运行方式比appium要简单许多,因为appium依赖性方较多,尤其是在做iOS连接appium时需要xcode中编译的webdriveragent工具来协助运行自动化环境,特别容易在运行中自动中断自己就删除了?,因此会带来很多麻烦
- 环境部署
- 电脑上需要有已配置好的adb的环境(网上教程很多,这里就不细讲了)
- 安装python的uiautomator2库
pip install -U uiautomator2 出现Successfully installed的标识就说明安装成功
-
-
在手机上安装atx-agent
1)使用adb命令连接手机并查出序列号 adb devices
2)在python中编写启动脚本,就可以直接在手机上直接安装atx(安装好后会出现一个小汽车的图标)
import uiautomator2 as u2 d = u2.connect_usb('9YS0220813028584')# 按序列号连接手机 print(d.info) d.app_start('包名')# 启动app(包名) 如何获取app的包名可以参考我的其他文章
-
3)安装weditor
pip3 install weditor==0.6.4
4)启动weditor
python -m weditor
到这里关于uiautomator2的自动化环境就搭建好了! 大家有疑问或好的想法可以在评论区一起讨论~
?
- 测试工具 uiautomator2 uiautomator 工具测试工具uiautomator2 uiautomator工具 测试工具uiautomator2 uiautomator原理 uiautomator2 uiautomator2截图uiautomator报告 uiautomator2 uiautomator activity页面 39 attributeerror mutablemapping uiautomator2 uiautomator2 uiautomator链接 手机 uiautomator2 uiautomator环境 教程 uiautomator2 uiautomator weditor python uiautomator2 uiautomator toast