当前位置:朝夕网 » 数码科技 » Airtest入门及多设备管理总结

Airtest入门及多设备管理总结

1. 简单入门1.1 准备图1. AirtestIDE 后台日志图2. AirtestIDE UI界面1.3 连接设备1.4 UI定位图4. AirtestIDE UI定位1.5 脚本1.6 运行2.

1. 简单入门1.1 准备

图1. AirtestIDE 后台日志

图2. AirtestIDE UI界面

1.3 连接设备

1.4 UI定位

图4. AirtestIDE UI定位

1.5 脚本

1.6 运行

2. 多线程中使用Airtest

2.1 安装

2.2 多设备连接

fromairtest.core.apiimport*frompoco.drivers.android.uiautomationimportAndroidUiautomationPoco

classAndroidUiautomationHelper(object):_nuis={}@classmethoddefget_instance(cls,device):&

classKeepRunningInstrumentationThread(threading.Thread):&

2.4 设备异常处理

defrshell_nowait(self,command,proc_name):&

defcheck_device(serialno,retries=3):for_inrange(retries)try:adb=ADB(serialno)adb.wait_for_device(timeout=timeout)devices=[item[0]foriteminadb.devices(state=&

defsilent(func):&

3.结语


以上就是朝夕生活(www.30zx.com)关于“Airtest入门及多设备管理总结”的详细内容,希望对大家有所帮助!

免责声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如有侵权行为,请第一时间联系我们修改或删除,多谢。朝夕网 » Airtest入门及多设备管理总结