代码:
from appium import webdriver
desire_cap = {
"platformName": "Android",
"deviceName": "127.0.0.1:16384",
"appPackage": "com.xueqiu.android",
"appActivity": ".view.WelcomeActivityAlias",
"noRest": "True"
}
driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desire_cap)
driver.implicitly_wait(10)
报错信息:
Traceback (most recent call last):
File "E:\python\pycharm\pythonProject\pytestdemo\appiumTest\appiumdemo.py", line 16, in
driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desire_cap)
File "E:\python\pycharm\pythonProject\pytestdemo\venv\lib\site-packages\appium\webdriver\webdriver.py", line 229, in __init__
super().__init__(
File "E:\python\pycharm\pythonProject\pytestdemo\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 185, in __init__
capabilities = options.to_capabilities()
AttributeError: 'NoneType' object has no attribute 'to_capabilities'
此处我是用的是Appium-Python-Client 2.11.0和Selenium 4.10.0版本
使用其他版本也可以,可以逐个试一下。