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.

资源链接#

posted @   两小无猜  阅读(491)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
主题色彩
点击右上角即可分享
微信分享提示