AttributeError: 'NoneType' object has no attribute 'recovery'

项目:Python + UIAutomator 安卓端自动化测试

问题:编译用例之后提示“AttributeError: 'NoneType' object has no attribute 'recovery'

AttributeError: 'NoneType' object has no attribute 'recovery'

原因分析:

1.打开报错代码行,查看是否对象没有属性

AttributeError: 'NoneType' object has no attribute 'recovery'

进入对应函数发现并不像Error所说无属性

2.无奈之下只能一步步从初始化查起,发现是因为定义对象问题,少了标点符号!!!!

AttributeError: 'NoneType' object has no attribute 'recovery'


在这里记录这个低级错误,找了大半天才发现了。