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

appium中urllib3.exceptions.LocationValueError: No host specified. 的错误解决办法

目录

错误收集

错误分析

解决办法

运行结果 


错误收集

D:\Program\Util\python.exe C:\Users\Administrator\PycharmProjects\Appium_Real\demo.py 
Traceback (most recent call last):
  File "C:\Users\Administrator\PycharmProjects\Appium_Real\demo.py", line 12, in <module>
    do_driver = webdriver.Remote('http:127.0.0.1:4723/wd/hub',options=UiAutomator2Options().load_capabilities(cap))
  File "D:\Program\Util\Lib\site-packages\appium\webdriver\webdriver.py", line 253, in __init__
    super().__init__(
    ~~~~~~~~~~~~~~~~^
        command_executor=command_executor,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
        client_config=client_config,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "D:\Program\Util\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 261, in __init__
    self.start_session(capabilities)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "D:\Program\Util\Lib\site-packages\appium\webdriver\webdriver.py", line 344, in start_session
    response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps)
  File "D:\Program\Util\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 451, in execute
    response = cast(RemoteConnection, self.command_executor).execute(driver_command, params)
  File "D:\Program\Util\Lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 404, in execute
    return self._request(command_info[0], url, body=data)
           ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Util\Lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 428, in _request
    response = self._conn.request(method, url, body=body, headers=headers, timeout=self._client_config.timeout)
  File "D:\Program\Util\Lib\site-packages\urllib3\_request_methods.py", line 143, in request
    return self.request_encode_body(
           ~~~~~~~~~~~~~~~~~~~~~~~~^
        method, url, fields=fields, headers=headers, **urlopen_kw
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "D:\Program\Util\Lib\site-packages\urllib3\_request_methods.py", line 278, in request_encode_body
    return self.urlopen(method, url, **extra_kw)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program\Util\Lib\site-packages\urllib3\poolmanager.py", line 448, in urlopen
    conn = self.connection_from_host(u.host, port=u.port, scheme=u.scheme)
  File "D:\Program\Util\Lib\site-packages\urllib3\poolmanager.py", line 310, in connection_from_host
    raise LocationValueError("No host specified.")
urllib3.exceptions.LocationValueError: No host specified.

Process finished with exit code 1

错误分析

urllib3.exceptions.LocationValueError: No host specified.

看这个 语句,host没有明确规定,这个大概意思是说们的host地址写的可能有错误,或者appium出现了问题

解决办法

  1. 滚动到首行
  2. 点击文件 ===》跳转到指定代码。发现这个appium的服务器地址可能有错误,
  3. 这里使用的是最新版的appium,使用的是node版本,这个应该是 
    127.0.0.1:4723
  4. 这个是最新的,不要加http和后面的,
  5. 看一下appium服务,发现这个出现了问题。我们关闭重新启动一下

运行结果 

http://www.lryc.cn/news/607999.html

相关文章:

  • cv快速input
  • InfluxDB 与 Node.js 框架:Express 集成方案(二)
  • SpringBoot与TurboGears2跨栈、整合AI服务、智能客服路由系统整合实战
  • 基于Redis自动过期的流处理暂停机制
  • dbt中多源数据的处理
  • 仿真电路:(十七下)DC-DC升压压电路原理简单仿真
  • Git下载及安装保姆级教程
  • 电子电气架构 --- 汽车网络安全概述
  • 深入 Go 底层原理(九):context 包的设计哲学与实现
  • 八股取士-go
  • python爬取豆瓣电影评论通用代码
  • Getedit-得辑SCI论文润色的重要性?
  • 自动驾驶:技术、应用与未来展望——从开创到全面革新交通出行
  • 【Linux系统】详解,进程控制
  • mongo,mongod,mongos指令
  • 【Linux】vim—基操
  • hcip---ospf知识点总结及实验配置
  • 剧本杀小程序系统开发:构建数字化剧本杀生态圈
  • rosdep的作用以及rosdep install时的常用参数
  • [论文阅读] 人工智能 + 软件工程 | GitHub Marketplace中CI Actions的功能冗余与演化规律研究
  • DDD Repository模式权威指南:从理论到Java实践
  • 网络基础实操篇-05-路由基础-最佳实践
  • 从C++0基础到C++入门(第十四节:流程程序结构第三部分【三目运算符与多种书写方式)】)
  • 基于单片机一氧化碳CO检测/煤气防中毒检测报警系统
  • linux中挂载磁盘和卸载
  • Redis面试精讲 Day 7:GEO地理位置应用详解
  • WinForm之ListBox 控件
  • 通过filezilla在局域网下实现高速传输数据
  • 音频3A处理简介之AGC(自动增益控制)
  • C/C++常用字符串函数