Issue 1: C:\Python36\lib\unittest\case.py:633: ResourceWarning: unclosed
Solution:
https://www.cnblogs.com/cherry-ning/articles/11187673.html
issue 2: UiAutomator quit before it successfully launched
solution:
从appium的日志找到错误: UiAutomationService android.accessibilityservice.IAccessibilityServiceClientS t u b StubStubProxy@6ac370ealready registered!
https://wenda.jikexueyuan.com/question/25363/
停止uiautomator的方法:
1、查询uiautomator进程 windows系统方式 adb shell ps | find “uiautomator”
2、结束进程 第一步查询出pid,然后运行 adb shell kill
issue 3: uiautomator,capture screen, 报错:Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn’t exist!
Solution:
多重启几次app
Issue 4: 使用appium在android7.0真机上测试程序时报错command failed shell "ps ‘uiautomator’"的解决方式
solution:
https://blog.csdn.net/pjl6523853/article/details/72886048
用solution 2解决
issue 5: Appium报错Requested a new session but one was in progress
solution:
solution1: 加上driver.quit()
solution2:
重新停止appium服务,开启Appium服务
在Genarel Setting那里设置覆盖Session,重启Appium
issue 6: adb: failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unicode_ime_apk\UnicodeIME-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.android.ime without first uninstalling.]
solution:
https://www.cnblogs.com/syw20170419/p/8289056.html
笨办法:手机输入法设置成appium输入法,注释掉代码中的设置
#desired_caps[‘unicodeKeyboard’] = ‘true’
Issue 7: File “C:\Python36\lib\site-packages\HTMLTestRunner.py”, line 766, in _generate_report_test uo = o.decode(‘latin-1’)AttributeError: ‘str’ object has no attribute ‘decode’
Solution:
HTMLTestRunner.py是从Python2版本由2to3.py自动转换的,修改HTMLTestRunner.py:
uo = o.decode(‘latin-1’) -> uo = o
ue = e.decode(‘latin-1’) -> ue = e
issue 8: [WinError 10061] No connection could be made because the target machine actively refused it
或
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
solution:
因为忘记启动Appium, 启动后就OK了
issue 9: 验证码输入框一个一个输有时候不行,光标乱定位
Solution:
一次性输入4个数字
verificationCode_xpath = ‘//*[@resource-id=“com.example.jobAndroid:id/vc_code”]/android.widget.EditText[contains(@index,3)]’
driver.find_element_by_xpath(verificationCode_xpath).send_keys(“1”, “1”, “1”, “1”)
Issue 10: License for package Android SDK Build-Tools 29.0.2not accepted
Solution:
https://blog.csdn.net/qq_34344752/article/details/104974801