Appium(使用Python)无法启动应用程序(错误/wd/hub/session(由NewConnectionError('<urlib3.connection.HTTPConnection)引起)

2024-05-23 13:56:37 发布

您现在位置:Python中文网/ 问答频道 /正文

当我运行下面的程序来启动python程序来启动android应用程序时,我得到以下错误: 引发MaxRetryError(_池、url、错误或响应错误(原因)) urllib3.exceptions.MaxRetryError:HTTPConnectionPool(host='0.0.0',port=4723):url:/wd/hub/session超过了最大重试次数(由NewConnectionError引起('<;urllib3.connection.HTTPConnection对象位于0x00001B1D68BDB20>;:未能建立新连接:[WinError 10049]请求的地址在其上下文中无效'))

环境:Windows10,Appium v1.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)

请帮忙


Tags: 程序comurlpytest错误capsandroidhub