標籤:mes quit http contact request module drive ogre back
一、自動刪除contactmanager
自動化測試appium提供的sample如下包/activity:com.example.android.contactmanager/.ContactManager ,發現提示如下錯誤
info: [debug] Error: Activity used to start app doesn‘t exist or cannot be launched! Make sure it exists and is a launchable activity
> at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:1146:21)
> at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:180:9)
> at ChildProcess.exithandler (child_process.js:742:7)
> at ChildProcess.emit (events.js:110:17)
> at maybeClose (child_process.js:1016:16)
> at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
> info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Activity used to start app doesn‘t exist or cannot be launched! Make sure it exists and is a launchable activity)","origValue":"Activity used to start app doesn‘t exist or cannot be launched! Make sure it exists and is a launchable activity"},"sessionId":null}
> info: <-- POST /wd/hub/session 500 2518.066 ms - 346
發現提示該包不存在。很奇怪我安裝了之後確認能夠運行了之後再啟動並執行自動化代碼,為什麼提示不存在呢?
於是觀察模擬器運行介面資訊,發現啟動代碼後自動把模擬器中的contactmanager刪除了,那當然找不到這個包和activity啦。
二、Failed to start an Appium session, err was: Error: Requested a new session but one was in progress
這是由於之前的會話沒有關閉,然後你又開啟了測試執行個體,解決方案:
1. 停止appium服務
2. 在Genarel Setting那裡設定覆蓋Session,重啟Appium
測試結束在AfterClass加driver.quit()
Appium+python自動化測試過程中問題