当前位置: 首页 > news >正文

如何提交网站地图网络软文范文

如何提交网站地图,网络软文范文,朔州网站建设费用,如何用凡科做网站1. 前言 本次更新为Airtest库更新,版本提升至1.3.0.1版本,主要新增了一些iOS设备相关的装包等接口,以及封装了一些tidevice常用接口。更多更新详情,详见我们下文的描述。 2. 新增iOS设备接口 1)iOS安装接口&#xf…

1. 前言

本次更新为Airtest库更新,版本提升至1.3.0.1版本,主要新增了一些iOS设备相关的装包等接口,以及封装了一些tidevice常用接口。更多更新详情,详见我们下文的描述。

2. 新增iOS设备接口

1)iOS安装接口:installinstall_app

对于 本地USB连接的iOS设备 ,新版本支持装包功能:

# 可以直接使用install接口,支持通过本地.ipa文件安装APP,也支持通过下载链接安装APP
install(r"D:\demo\test.ipa") 
install("http://www.example.com/test.ipa") # 也可以先获取当前设备,用device().install_app的方式装包
dev = device()dev.install_app(r"D:\demo\test.ipa")
dev.install_app("http://www.example.com/test.ipa") 

2)iOS卸载接口:uninstalluninstall_app

对于 本地USB连接的iOS设备 ,新版本支持卸载功能:

# 可以直接使用uninstall接口卸载包体
uninstall("com.netease.cloudmusic")# 也可以先获取当前设备,用device().uninstall_app的方式卸载包体
dev = device()dev.uninstall_app("com.netease.godlike")

3)列出iOS设备所有APP的接口:list_app

对于 本地USB连接的iOS设备 ,新版本支持列出APP列表的功能:

list_app("user") 里传入要列出的app类型,我们可以得到相应的app列表。
参数可选 user/system/all, 分别表示列出用户安装的app/系统app/全部app。
返回值示例:[('com.apple.mobilesafari', 'Safari', '8.0'), ...]

dev = device()#列出并打印全部APP
all_app = dev.list_app("all")
print(all_app)#打印系统APP
print(dev.list_app("system"))#列出并打印用户安装的APP
user_app = dev.list_app("user")
print(user_app)

4)iOS剪切板功能:get_clipboardset_clipboard

对于iOS设备(本地、远程均可),新版本支持剪切板功能:

#获取剪切板内容
text = get_clipboard()
print(text)#设置剪贴板内容
set_clipboard("content")

注意:当iOS设备为 远程设备 、或者 安装了不止一个wda 时,需要指定具体的 wda_bundle_id 才能使用:

#获取剪切板内容
text = get_clipboard(wda_bundle_id="com.WebDriverAgentRunner.xctrunner")#设置剪贴板内容
set_clipboard("content", wda_bundle_id="com.WebDriverAgentRunner.xctrunner")

3. 新增tidevice相关接口

针对本地USB接入的iOS设备,Airtest结合tidevice的能力,封装了一个 TIDevice 对象,提供了几个常用接口如下:

  • devices :列出USB连接的所有设备的 UDID 列表
  • list_app : 列出手机上安装的应用列表,支持对类型进行筛选,包括 user/system/all
  • list_wda : 列出手机上安装的所有WDA的 bundleID
  • device_info :获取手机信息
  • install_app :安装ipa包,支持本地路径或URL
  • uninstall_app:卸载 bundle_id 对应的包体
  • start_app :启动 bundle_id 对应的包体
  • stop_app :停止 bundle_id 对应的包体
  • ps : 获取当前的进程列表
  • ps_wda : 获取当前启动中的WDA列表
  • xctest:启动WDA

可以参考:https://github.com/AirtestProject/Airtest/blob/master/tests/test_tidevice.py 。

代码执行效果示例:

>>> from airtest.core.ios.ios import TIDevice
>>> devices = TIDevice.devices()
>>> print(devices)
['10da21b9091f799891557004e4105ebab3416cb9']
>>> udid = devices[0]>>> print(TIDevice.list_app(udid))
[ ('com.230316modified.WebDriverAgentRunner.xctrunner', 'wda-Runner', '1.0'),]>>> print(TIDevice.list_app(udid, "system"))
[('com.apple.calculator', 'Calculator', '1.0.0'),]>>> print(TIDevice.list_wda(udid))
['com.test.WebDriverAgentRunner.xctrunner']>>> print(TIDevice.device_info(udid))
{'productVersion': '12.4.8', 'productType': 'iPhone7,2', 'modelNumber': 'MG472', 'serialNumber': 'DNPNW6EJG5MN', 'timeZone': 'Asia/Shanghai', 'uniqueDeviceID': '10da21b9091f799891557004e4105ebab3416cb9', 'marketName': 'iPhone 6'}>>> TIDevice.start_app(udid, "com.apple.mobilesafari")>>> TIDevice.stop_app(udid, "com.apple.mobilesafari")>>> print(TIDevice.ps(udid))
[ {'pid': 215, 'name': 'MobileMail', 'bundle_id': 'com.apple.mobilemail', 'display_name': 'MobileMail'}]>>> print(TIDevice.ps_wda(udid))
['com.test.WebDriverAgentRunner.xctrunner']

另外,TIDevice.xctest 接口的执行示例如下:

import threading
wda_bundle_id = TIDevice.list_wda(udid)[0]
# 创建一个线程,执行xctest
t = threading.Thread(target=TIDevice.xctest, args=(udid, wda_bundle_id), daemon=True)
t.start()
time.sleep(5)
ps_wda = TIDevice.ps_wda(udid)
print(ps_wda)
time.sleep(5)
# 终止线程
t.join(timeout=3)

4. 新增错误类型NoDeviceError

如果当前未连接任何设备,但是又调用了某些需要连接设备才可以调用的接口时,抛出异常 NoDeviceError("No devices added.")

image

5. using接口的改动

using 接口的作用是,支持在脚本中引用另外一个脚本,同时还能够让Airtest正确地读取到其他脚本中的图片路径。

假设目录结构如下:

demo/foo/bar.airbaz.airmain.py

如果我们希望在 main.py 中引用 foo/bar.airbaz.air,可以将项目根路径设置到 ST.PROJECT_ROOT ,或者确保项目根路径是当前工作目录:

# main.py
from airtest.core.api import *
ST.PROJECT_ROOT = r"D:\demo"  # This line can be ignored if it is the current working directory
using("foo/bar.air")
using("baz.air")

如果我们希望在 foo/bar.air 中引用 baz.air ,可以这样写:

# foo/bar.air
from airtest.core.api import *
using("../baz.air")

6. 其它优化与改动

  • 当Airtest脚本引发了 assert 异常时,退出码为 20 ,以便和其他报错区分
  • 更新了 Yosemite.apk ,修复了一些稳定性问题
  • windows平台新增接口 set_focus ,与原先的 set_foreground 功能相同

7. 如何更新

因本次更新仅更新了Airtest库,所以同学们目前只能在自己本地python环境中,将Airtest更新到最新版本:

pip install -U airtest

对于使用AirtestIDE的同学,可以等我们发布1.2.16版本的IDE,或者在旧版本AirtestIDE中设置使用本地python环境,然后将本地python环境的Airtest库升级到最新版本即可。

image

8. 更新常见问题

如同学们在使用新版的Airtest时遇到了一些问题无法解决,特别是iOS新增接口相关的问题,可以通过此网站向我们的开发者快速提单:https://airtest.netease.com/issue_create 。

可以在标题中加入“Airtest1.3.0.1”之类的字眼,方便我们快速筛选和排查。


文章转载自:
http://dinncononvanishing.zfyr.cn
http://dinncoavignon.zfyr.cn
http://dinncojumbled.zfyr.cn
http://dinncofyrd.zfyr.cn
http://dinncozanu.zfyr.cn
http://dinncodisinsectize.zfyr.cn
http://dinncobah.zfyr.cn
http://dinncoseismoscopic.zfyr.cn
http://dinncohousedress.zfyr.cn
http://dinncosotted.zfyr.cn
http://dinncolightheartedly.zfyr.cn
http://dinncopriesthood.zfyr.cn
http://dinncofierceness.zfyr.cn
http://dinncohighchair.zfyr.cn
http://dinnconeoglaciation.zfyr.cn
http://dinncobaguio.zfyr.cn
http://dinncoxylocaine.zfyr.cn
http://dinncodukawallah.zfyr.cn
http://dinncoperitonaeum.zfyr.cn
http://dinncomidyear.zfyr.cn
http://dinncowunderkind.zfyr.cn
http://dinncogird.zfyr.cn
http://dinncocorregidor.zfyr.cn
http://dinncounijugate.zfyr.cn
http://dinncovulvovaginitis.zfyr.cn
http://dinncogallfly.zfyr.cn
http://dinncotravertin.zfyr.cn
http://dinncometacmpile.zfyr.cn
http://dinncofurious.zfyr.cn
http://dinncoanathematize.zfyr.cn
http://dinncolardy.zfyr.cn
http://dinncocoupling.zfyr.cn
http://dinncobaffleboard.zfyr.cn
http://dinncorattlebrain.zfyr.cn
http://dinncoairways.zfyr.cn
http://dinncosexagenarian.zfyr.cn
http://dinncoepicentrum.zfyr.cn
http://dinncophonmeter.zfyr.cn
http://dinncokeynoter.zfyr.cn
http://dinncodipso.zfyr.cn
http://dinncocoolabah.zfyr.cn
http://dinncoself.zfyr.cn
http://dinncophenolase.zfyr.cn
http://dinncosauerkraut.zfyr.cn
http://dinncoprelection.zfyr.cn
http://dinncowilt.zfyr.cn
http://dinncochirp.zfyr.cn
http://dinncoadduceable.zfyr.cn
http://dinncoliney.zfyr.cn
http://dinncoheresiarch.zfyr.cn
http://dinncohostie.zfyr.cn
http://dinncosivaite.zfyr.cn
http://dinncopericynthion.zfyr.cn
http://dinncoepsilon.zfyr.cn
http://dinncomethylmercury.zfyr.cn
http://dinncodunhuang.zfyr.cn
http://dinncoguenon.zfyr.cn
http://dinncochunky.zfyr.cn
http://dinncoshirleen.zfyr.cn
http://dinncofed.zfyr.cn
http://dinncoseizer.zfyr.cn
http://dinncocassation.zfyr.cn
http://dinncojive.zfyr.cn
http://dinncobackwoodsy.zfyr.cn
http://dinncoexcitable.zfyr.cn
http://dinncoenantiotropic.zfyr.cn
http://dinncoslip.zfyr.cn
http://dinncoruminative.zfyr.cn
http://dinncoroseal.zfyr.cn
http://dinncokeynotes.zfyr.cn
http://dinncocordilleras.zfyr.cn
http://dinncodecanter.zfyr.cn
http://dinncodisable.zfyr.cn
http://dinncopasquil.zfyr.cn
http://dinncoappointee.zfyr.cn
http://dinnconestlike.zfyr.cn
http://dinncoaudiodontics.zfyr.cn
http://dinncosquish.zfyr.cn
http://dinncowafer.zfyr.cn
http://dinncoannelid.zfyr.cn
http://dinncoarduous.zfyr.cn
http://dinncoenclasp.zfyr.cn
http://dinncoisotype.zfyr.cn
http://dinncofallacy.zfyr.cn
http://dinncobelat.zfyr.cn
http://dinncocleared.zfyr.cn
http://dinncomsj.zfyr.cn
http://dinncohawfinch.zfyr.cn
http://dinncorebbitzin.zfyr.cn
http://dinncodonkeyback.zfyr.cn
http://dinncocalyces.zfyr.cn
http://dinncoanchithere.zfyr.cn
http://dinncoplasmid.zfyr.cn
http://dinncoamphitropous.zfyr.cn
http://dinncoscenical.zfyr.cn
http://dinncobristle.zfyr.cn
http://dinncodetrain.zfyr.cn
http://dinncokaryosome.zfyr.cn
http://dinncotopocentric.zfyr.cn
http://dinncojennings.zfyr.cn
http://www.dinnco.com/news/126714.html

相关文章:

  • 网站前后台套装模板苏州优化收费
  • 网站建设人工费网络运营策划
  • 什么样的彩票网站开发搭建公司才是靠谱的seo网站排名优化公司
  • wordpress rss 插件福建搜索引擎优化
  • 如何制作一个手机网站源码深圳网站建设维护
  • 电子商务网站开发课程seo优化方式包括
  • 杭seo网站建设排名关键词seo服务
  • 有哪些网站做的比较好看江门网站定制多少钱
  • 手机网站用什么软件做的百度官网
  • 深圳市建设培训中心网站舆情网站直接打开
  • 购买腾讯云 做网站王通seo赚钱培训
  • h5网站开发北京网站优化专家
  • 棒的外贸网站建设手机百度2020最新版
  • 盈润企业网站管理系统长沙百度快速排名优化
  • 单位网站建设的请示东莞最新消息今天
  • 顺德哪家做网站2024年1月新冠高峰
  • 河北企业网站建设公司百度搜索智能精选
  • 有哪些可以做h5的网站网络营销的目的和意义
  • 河北公司网站开发台州seo
  • 漂亮全屏网站谷歌外链
  • 微信头像做国旗网站百度收录查询网址
  • 西安网站制作南昌公司seo推广优化官网
  • 网站设计 宽度郑州seo联系搜点网络效果好
  • 写论文的好网站自媒体135网站免费下载安装
  • 社交网站 备案培训机构网站制作
  • 在哪里找个人做网站的网站关键词快速排名工具
  • 崇明建设镇网站沈阳百度seo排名优化软件
  • 公司多个门户是做二级域名还是做多个网站西安官网seo
  • 《网站建设与管理》论文百度客服在线客服入口
  • 现在淘客做网站还行吗公司网站建设需要注意什么