Appium + python 进行iOS设备的UI自动化测试遇到的问题

以前通过这套框架接入Android时问题还不是很多,很轻松就能成功,但是到了iOS这里就各种报错,需要安装的插件也比Android多了好多。以下是本次iOS端遇到的问题。

参考文档

  1. Appium + IOS 自动化环境搭建教程
  2. IOS+Appium 自动化测试环境搭建

问题与解决方案

设置端口转发之后,在浏览器打开http://127.0.0.1:8100/inspector无法启动,返回的错误信息如下

"Unhandled endpoint: \/inspector -- http:\/\/127.0.0.1:8100\/ with parameters {\n    wildcards =     (\n        inspector\n    );\n}

这个是因为最新版本的appium已经将内置的inspector独立了出去,所以需要单独安装inspector进行调试。


使用appium-inspector无法连接真机,报错如下

Failed to create session. An unknown server-side error occurred while processing the command. Original error: '14.6' does not exist in the list of simctl SDKs. Only the following Simulator SDK versions are available on your system: 16.1

Github-issues
如果要使用,必须设置连接的真实设备的udid。否则 Appium 将尝试匹配模拟器

查询udid方式:

  1. 打开XCode,Windows -> Devices and Simulators ,查看当前连接的iPhone的信息中,identifier就是udid。
  2. 需要在Mac上使用 libimobiledevice 进行查询,安装方法如下:brew install libimobiledevice --HEAD ,之后在命令行中执行 idevice_id -l 就可以看到当前连接设备的udid。

添加udid之后继续报错,如下

Failed to create session. An unknown server-side error occurred while processing the command. Original error: The port #8100 is occupied by an other process. You can either quit that process or select another free port.

资源链接

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值