一、前提条件
- 设备安装python3
2.设置pip清华源
pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
参考:https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
二、安装weditor
pip3 install weditor
github:https://github.com/alibaba/web-editor
三、启动weditor
python3 -m weditor
四、使用
1、启动weditor后,会自动启用一个web页面,如下所示
!](https://img-blog.csdnimg.cn/direct/8af64a984dfa4dba8cfbf77f41465d84.png)
2、连接完成后,点击Dump Hierarchy,会显示当前页面
3、鼠标在页面上滑动,选择要点击的控件,然后点击Tap,会自动点击,并把当前代码自动生成
4、完成所有代码后,拷贝到PyCharm单独文件后,加上一些时间控制和循环控制逻辑后,即可以开始自动化测试