Appium使用 Python - 无法启动应用程序错误 /wd/hub/session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection)

问题描述

当我运行下面的程序来启动 python 程序来启动 android 应用程序时,我收到以下错误: 引发 MaxRetryError(_pool,url,error 或 ResponseError(cause)) urllib3.exceptions.MaxRetryError: httpconnectionPool(host='0.0.0.0',port=4723): Max retries exceeded with url: /wd/hub/session (由 NewConnectionError('):无法建立新连接:[WinError 10049] 请求的地址在其上下文中无效'))

环境:Windows10,Appium v​​1.20.2

库列表:

Appium-Python-Client~=1.0.2
selenium~=3.141.0
pytest~=6.1.1
allure-pytest
pytest-parallel
pytest-xdist
pytest-rerunfailures
pytest-sugar
pytest-json
pyMysqL~=0.10.1
sshtunnel~=0.1.5
requests~=2.24.0
invoke~=1.4.1
python-dotenv
pytest-html-reporter~=0.2.3


from appium import webdriver

desired_caps= {}
desired_caps['platformName']='Android'
desired_caps['automationName']='UiAutomator2'
desired_caps['platformVersion']='9'
desired_caps['deviceName']='TKX44XS8DAVWNRMZ'
desired_caps['app']='path/Android-NativeDemoApp-0.2.1.apk'
desired_caps['appPackage']='com.wdiodemoapp'
desired_caps['appActivity']='com.wdiodemoapp.MainActivity'
driver = webdriver.Remote('http://0.0.0.0:4723/wd/hub',desired_caps)

请帮忙。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...