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

扬州专业网站制作汽车软文广告

扬州专业网站制作,汽车软文广告,网站制作 文案,品牌包包排行榜本文介绍如何使用tideviceWDAairtest/facebook-wda实现在Windows上进行IOS APP自动化测试 环境准备 Windows Python环境 Python 3.6 WebDriverAgent安装 下载最新的项目到Mac:https://github.com/appium/WebDriverAgent $ git clone https://github.com/appiu…

本文介绍如何使用tidevice+WDA+airtest/facebook-wda实现在Windows上进行IOS APP自动化测试

环境准备

Windows Python环境

Python 3.6+

WebDriverAgent安装

下载最新的项目到Mac:https://github.com/appium/WebDriverAgent

$ git clone https://github.com/appium/WebDriverAgent.git

用Xcode打开
Xcode -> Preference,添加账户

在这里插入图片描述

修改WebDriverAgentRunner这个项目的Bundle ID(不要与原来的重复就行)

在这里插入图片描述

Product —> Destination —> 选择真机设备
在这里插入图片描述

Product —> Scheme —> WebDriverAgentRunner(选择Scheme为WebDriverAgentRunner)
在这里插入图片描述

Product —> Build For —> Testing,将项目运行到真机设备上
在这里插入图片描述

这时手机就装上了一个名为WebDriverAgentRunner的应用
在这里插入图片描述

注意如果用的是企业证书安装或打包的ipa包进行安装可能需要在通用设置设备管理中添加信任后才能正常运行WDA。(如果没有Mac,可以请IOS的同事帮忙安装)

tidevice库安装

pip install -U tidevice

安装成功后查看版本:

> tidevice version
tidevice version 0.10.1

此时,将手机连接到Windows,就可以查看连接设备信息

> tidevice list
UDID                       SerialNumber    NAME         MarketName      ProductVersion  ConnType
0000xxx-00xx65xx22xx00xx  DNXXW28XXDYV    iPhone18臻享版  iPhone 14                 15.7  usb> tidevice list --json
[{"udid": "0000xxx-00xx65xx22xx00xx","serial": "DNXXW28XXDYV","name": "iPhone18臻享版","market_name": "iPhone 14","product_version": "15.7","conn_type": "usb"}
]

此外,tidevice还有许多常用指令

# 查看设备信息
tidevice info
# 截图(注意这是将截图保存到xx.jpg文件中,所以该图片是保存在电脑端的当前输指令的目录下,而不是在手机中)
tidevice screenshot xx.jpg
# 启动应用程序
tidevice lanch Bundle ID (Bundle ID表示包名)
如:
tidevice launch tv.danmaku.bilianime
# 停止程序
tidevice kill Bundle ID
# 查看第三方包名(Bundle ID)
tidevice applist
# 重启设备
tidevice reboot# 关机
tidevice shutdown
# 安装应用# 安装本地包
tidevice install C:\example.ipa# 安装远程包
tidevice install https://.....ipa# 多台手机时,指定uid安装
tidevice -u uid  install C:\test.ipa
# 卸载应用
tidevice uninstall 包名
# 多台手机时,指定uid卸载应用
tidevice -u uuid uninstall 包名
# 查看电池信息
tidevice info --domain com.apple.mobile.batterytidevice battery
# 更多帮助
tidevice -h

启动WDA驱动器

tidevice -u [udid] wdaproxy -B [wda 的 bundle Id] --port 8100
例:
tidevice -u 1238101-00012345688001E wdaproxy -B com.facebook.wda.xxxnApp --port 8100

启动成功会有如下提示:
在这里插入图片描述

验证启动WDA是否成功

在浏览器中输入http://localhost:8100/,如果有返回信息,则证明WDA启动成功。

http://localhost:8300/status可以查看当前设备的状态,获取与wda通信session id
在这里插入图片描述
同时,启动成功后手机屏幕上会有Automation Running Hold both volume buttons to stop的水印。

完成上述环境配置后,也意味着IOS可以脱离Mac,使用Windows进行自动化操作了。

Python + facebook-wda 自动化

安装facebook-wda

pip install -U facebook-wda
import wda
ct = wda.Client("http://localhost:8100")# 打印设备信息
print(ct.info)# 三种打开应用的方式
# ct.session("com.sina.weibo")
# ct.session().app_activate("tv.danmaku.bilianime")
# ct.session().app_launch("com.alipay.iphoneclient")# 打印当前所在APP的Bundle ID
print(ct.session().app_current())# 截图
# ct.screenshot(r"C:\Users\sg0100\Desktop\test.jpg")

airtest 自动化

安装airtest,打开后在主界面的右下方 “连接IOS设备” 会自动获取到连接地址,点击连接即可
在这里插入图片描述

在这里插入图片描述

from airtest.core.api import *
from airtest.report.report import simple_report# auto_setup(__file__, logdir=True, devices=["ios:///http://127.0.0.1:8100",])
auto_setup(__file__, logdir=True)
init_device(platform="IOS",uuid="http://localhost:8100/")start_app("com.apple.Preferences") # 打开【设置】touch(Template(r"tpl1675671163913.png", record_pos=(-0.197, 0.638), resolution=(1170, 2532)))   # 点击【通知】
http://www.hkea.cn/news/783996/

相关文章:

  • 茂名网站建设方案书简述seo和sem的区别
  • 江西网站做的好的企业文化百度指数在哪里看
  • 山东电商网站建设seo网站排名优化公司
  • 赤峰市做网站公司今日的最新消息
  • 上海最大的贸易公司seo网络推广机构
  • jsp 网站开发广告发布平台
  • b2c网站综合对比评价站长统计幸福宝
  • 网站建设意见做推广app赚钱的项目
  • 哈尔滨营销网站制作做外贸推广
  • 深圳网站建设外贸公司排名搜索热词排名
  • 网络科技公司招聘可靠吗seo多久可以学会
  • 企业网站建设的方案ppt网络营销的特点主要包括什么
  • 如何自行建设网站推广关键词优化
  • 建设学院网站百度收录关键词查询
  • 有关外贸的网站有哪些内容武汉抖音seo搜索
  • 娄底网站建设的话术深圳网站关键词排名优化
  • 福田大型商城网站建设seo营销方法
  • 网站开发专业就业指导企业网站设计与实现论文
  • 网络营销方式的思维导图seo关键词优化系统
  • wordpress访客ip记录福清市百度seo
  • 网站下载速度慢互联网广告推广公司
  • 电影网站空间配置网络营销的工具和方法有哪些
  • 包装设计网站免费百度seo搜索引擎优化厂家
  • 免费做公司网站sem对seo的影响有哪些
  • 网站空间购买费用关键词优化计划
  • 网站制作可以卖多少钱陕西网站建设制作
  • 深圳中小企业网站制作谷歌海外广告投放
  • 做游戏网站的需求分析创建app平台
  • 青岛胶南做网站的有多少seo商学院
  • 二月网站建设南宁百度个人中心登录