Appium+python自動化測試過程中問題

來源:互聯網
上載者:User

標籤: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自動化測試過程中問題

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.