使用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={"