目录
1、报错内容
在PyCharm编写好脚本后,模拟器和appium也是连接成功的,但是运行脚本时报错:
AttributeError: 'NoneType' object has no attribute 'to_capabilities'

2、解决方案
(1)检查
检查一下已安装的selenium、Appium-Python-Client的版本信息:
pip show selenium
pip show Appium-Python-Client

(2)报错原因
可以看到我安装的 selenium和Appium-Python-Client都是目前的最新版本,可能因为这样导致的两者不兼容,在GitHub中,对于appium-python-client的使用文档(点我查看)里面我们也能看到,官方已经给出了两者组合起来兼容性最好的版本是什么样的了:

(3)解决步骤
-
先卸载已经安装好的 selenium 和 Appium-Python-Client:
pip uninstall selenium
pip uninstall Appium-Python-Client

-
根据兼容搭配表里的所示,我们安装相对应的版本:
pip install selenium==4.11.2
pip install Appium-Python-Client==2.11.1

3、解决结果
可以看到已经没有报这个错了(虽然报了另一个错,那就接着解决新问题吧)
appium这边也抓到了log
