使用appium測(cè)試oppo真機(jī)遇到問(wèn)題記錄
1.問(wèn)題1,運(yùn)行的時(shí)候報(bào)錯(cuò):
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'
解決辦法:
注釋掉連接手機(jī)中的這兩項(xiàng):
'unicodeKeyboard': True,
'resetKeyBoard': True
2.運(yùn)行報(bào)錯(cuò):
Original error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.
解決辦法:
注釋掉連接手機(jī)中的一項(xiàng):將參數(shù)’automationName’的值'UiAutomator1’
3.手機(jī)端安裝好io.appium.uiautomator2.server.apk后,運(yùn)行代碼時(shí),手機(jī)端老提示需要重新安裝io.appium.uiautomator2.server.apk;
解決辦法:在連接手機(jī)中的選項(xiàng),添加'skipServerInstallation':True,就可以了。
4.打開(kāi)uiautomatorviewer工具,
報(bào)錯(cuò)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!
解決辦法:
關(guān)閉appium server重啟,重新連接測(cè)試真機(jī)。
5.Appium 運(yùn)行腳本報(bào)錯(cuò)InvalidSelectorException: Message: Locator Strategy 'css selector' is not supported for
根本原因1:電腦里安裝的selenium版本和Appium-Python-Client版本不兼容
解決辦法:卸載Appium-Python-Client,重安裝最新版本
6.
adb 命令
查看包名和啟動(dòng)頁(yè)
adb shell dumpsys activity recents |find "intent={"