Airtest界面说明
下面是Airtest的主界面,本篇将各个模块拆分大致说明

导航栏:主要是脚本文件的管理,和IDE的设置。与其他IDE基本一致,这里不再赘述。
Airtest辅助窗:可以快速插入部分操作代码。例

步骤:
1、在脚本编辑窗口,定位输入的光标;
2、点击touch,此时会提示

3、在设备窗口截取一段图片,就会生成代码

其它的选择也差不多,自行尝试~~
Poco辅助窗:可看到原生UI结构等信息
使用时,先根据设备选择对应的模式,例如选择Android(需要先连接手机)

脚本编辑窗口会出现一个提示,选择yes即可,会在光标处添加一下代码:
poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
这是poco的初始化代码,最好放在print("start...")前后

1、poco的功能,从左到右分别是锁定,定位,录制
锁定:点击此按钮,Airtest会停留在当前界面,即使手动切换设备页面,Airtest也不会切换界面;
定位:鼠标移动到某个元素或者控件(无需点击),在Log查看窗就能查看当前元素或者控件的信息;
录制:鼠标点击到某个元素或者控件,在脚本编辑窗口光标处就会录制下当前操作的脚本
2、当前页面的UI层级
详细展示当前页面的UI层级
Selenium窗口

使用与Airtest辅助窗一样,可以快速插入部分操作代码,具体使用参考Airtest辅助窗的描述~~
脚本编辑窗口:进行代码编辑的地方。
优点:有补全代码提示

缺点:无法打断点
在某一行代码中点击鼠标右键,会出现其它功能

点击“图片/代码模式切换”,可以将图片转化为代码展示,如上图的“待支付”转化为代码展示:

运行脚本:运行到某一行脚本代码时,会有颜色展示,例如:

Log查看窗:可以查看运行脚本时的各项Log信息;可以查看定位元素或控件的信息;
Log信息包含:INFO,DEBUG,WARNING,ERROR等。

调试脚本时,着重关注ERROR,如:

查看元素或控件信息:需要先选择Poco模式(Android),然后点击“定位”功能,将鼠标移到屏幕区域处,即可展示当前位置的元素或控件信息,如:

设备窗:可以查看设备信息,控制设备等,可分成四部分:

移动设备连接:连接成功后展示安卓设备信息,点击connect即可操作设备
远程设备连接:可以脱离数据线,通过设备IP进行操作,但是稳定性不高,所以不推荐使用
Windows窗口连接:当前未使用过,后续补充!
ios设备连接:展示ios设备信息,由于连接ios设备需要先在mac上部署项目,当前还未进行,后续补充!