20200810 airtest查看当前设备安装app 截图
程序员文章站
2022-03-11 16:24:26
#20200810#当前设备安装的appfrom airtest.core.android.android import Androiddevs = device()#返回当前活动设备print(devs.list_app(third_only=True))#截图 另存为本地文件# -*- encoding=utf8 -*-from airtest.core.api import *# crop_image()方法在airtest.aircv中,需要引入from airtest.airc...
#20200810
#当前设备安装的app
from airtest.core.android.android import Android
devs = device()#返回当前活动设备
print(devs.list_app(third_only=True))
#截图 另存为本地文件
# -*- encoding=utf8 -*-
from airtest.core.api import *
# crop_image()方法在airtest.aircv中,需要引入
from airtest.aircv import *
# 局部截图
screen = aircv.crop_image(screen,(0,160,1067,551))
screen = G.DEVICE.snapshot()
pil_img = cv2_2_pil(screen)
pil_img.save("C:/test20200810/git pull/首页.png", quality=99, optimize=True)# 保存局部截图到log文件夹中
try_log_screen(screen)
本文地址:https://blog.csdn.net/weixin_42540340/article/details/107934495