赞
踩
嗨,大家好,我是兰若姐姐,不知道大家在APP自动化测试过程中
有没有碰到这个错误 Could not connect to Appium server URL
“如何解决这个报错:Could not connect to Appium server URL ‘http://127.0.0.1:4723/’. Please check if the server is running and the URL is correct (valid URLs can be found at the start of the Appium server log). If you are using the Inspector’s browser version, ensure the server has been started with ‘–allow-cors’.”
Appium Server 没有启动:
确保 Appium 服务器已经正确启动。在终端或命令行中运行以下命令以启动 Appium 服务器:
appium
如果你使用的是 Appium Desktop,确保点击了“Start Server”按钮以启动服务器。
Appium Server 地址或端口配置错误:
http://127.0.0.1:4723/
是正确的。默认情况下,Appium 的地址是 http://127.0.0.1:4723/
或者 http://localhost:4723/
。网络问题:
127.0.0.1:4723
的访问。Appium Server 没有安装或安装有问题:
确保你已经安装了 Appium。可以使用以下命令进行安装:
npm install -g appium
检查 Appium 是否可以正常使用,运行 appium -v
来查看版本信息。
Appium Server 日志检查:
使用 ‘–allow-cors’ 参数启动 Appium Server:
如果你使用的是 Appium Inspector 的浏览器版本,需要确保启动服务器时启用了 CORS 支持:
appium --allow-cors
检查Appium服务是否绑定到正确的IP地址:
127.0.0.1
。总结一下,按照以下步骤检查和排查:
-allow-cors
参数启动 Appium 服务器,如有必要。Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。