使用python启动Android应用程序的示例代码,执行一直报:Traceback (most recent call last):
File "D:\PyCharmAuto_workstation\appium_test\examples\使用python启动Android应用程序的示例代码.py", line 22, in
driver = webdriver.Remote(server_url, desired_caps)
File "D:\python39\lib\site-packages\appium\webdriver\webdriver.py", line 227, in init
super().init(
File "D:\python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 218, in init
capabilities = options.to_capabilities()
AttributeError: 'NoneType' object has no attribute 'to_capabilities'
Appium-Python-Client |
4.4.0 |
4.4.0 |
import time
from appium import webdriver
# 设备的Desired Capabilities设置
desired_caps = {
"platformName": "Android",
"deviceName": "88Y5T19912029639",
# "platformVersion": "14",
"appPackage": "com.czur.scanpro",
"appActivity": "com.czur.scanpro/com.czur.scanpro.ui.base.IndexActivity"
}
# Appium服务器地址
server_url = "http://127.0.0.1:4723/wd/hub"
# 启动Appium驱动并连接到设备
driver = webdriver.Remote(server_url, desired_caps)
# 等待一段时间,以便应用程序完全启动
time.sleep(5)
欢迎来到testingpai.com!
注册 关于