赞
踩
问题:
运行python脚本:
- from appium import webdriver
-
- desired_caps = {}
- desired_caps['platformName'] = 'Android'
- # 模拟器安卓的版本号
- desired_caps['platformVersion'] = '9.0'
- desired_caps['deviceName'] = '127.0.0.1:6555'
- desired_caps['appPackage'] = 'com.android.settings'
- desired_caps['appActivity'] = 'com.android.settings.Settings'
- driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
报错 AttributeError: ‘NoneType‘ object has no attribute ‘to_capabilities’ 如图:
解决方法:
卸载selenium和appium, pip uninstall selenium, appium-python-client,
降低指定appium版本进行安装:pip install appium-python-client==2.0
这时pip会将对应的selenium版本一起下载,所以就不用再装selenium了!
接着重新运行python脚本即可!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。