当前位置:   article > 正文

解决报错 AttributeError: ‘NoneType‘ object has no attribute ‘to_capabilities‘_attributeerror: 'nonetype' object has no attribute

attributeerror: 'nonetype' object has no attribute 'to

问题:

运行python脚本:

  1. from appium import webdriver
  2. desired_caps = {}
  3. desired_caps['platformName'] = 'Android'
  4. # 模拟器安卓的版本号
  5. desired_caps['platformVersion'] = '9.0'
  6. desired_caps['deviceName'] = '127.0.0.1:6555'
  7. desired_caps['appPackage'] = 'com.android.settings'
  8. desired_caps['appActivity'] = 'com.android.settings.Settings'
  9. 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脚本即可!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/759083
推荐阅读
相关标签
  

闽ICP备14008679号