python+appium自動(dòng)化遇到的問(wèn)題記錄

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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容