python+appium自动化遇到的问题记录

使用appium测试oppo真机遇到问题记录

1.问题1,运行的时候报错:

Message: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error:

'Command 'D:\\android-sdk-windows\\platform-tools\\adb.exe -P 5037 -s b3b50f25 shell ime enable io.appium.settings/.UnicodeIME' exited with code 137'; Stderr: ''; C

ode: '137'

解决办法:

注释掉连接手机中的这两项:

'unicodeKeyboard': True,

'resetKeyBoard': True

2.运行报错:

Original error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.

解决办法:

注释掉连接手机中的一项:将参数’automationName’的值'UiAutomator1’

3.手机端安装好io.appium.uiautomator2.server.apk后,运行代码时,手机端老提示需要重新安装io.appium.uiautomator2.server.apk;

解决办法:在连接手机中的选项,添加'skipServerInstallation':True,就可以了。

4.打开uiautomatorviewer工具,

报错Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist! Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!

解决办法:

关闭appium server重启,重新连接测试真机。

5.Appium 运行脚本报错InvalidSelectorException: Message: Locator Strategy 'css selector' is not supported for

根本原因1:电脑里安装的selenium版本和Appium-Python-Client版本不兼容

解决办法:卸载Appium-Python-Client,重安装最新版本

6.

adb 命令

查看包名和启动页

adb shell dumpsys activity recents |find "intent={"

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容