2017-03-07 11 views
2

當android驅動程序發現一些元素時,appium被凍結([AndroidBootstrap]發送命令給android),並在一段時間後死亡。這隻發生在一臺計算機(Mac)上,只發生在android上。當向Android發送命令時Appium被凍結

最後appium發送此:

[Appium] New AndroidDriver session created successfully, session 7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d added to master session list 
[debug]  [MJSONWP] Responding to client with driver.createSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"/Users/jenkins/.jenkins/jobs/Android5-test-ReleaseIntegtationTests-Demo/workspace/test-Integration-Tests/src/test/resources/testDemo-debug.apk","noReset":true,"newCommandTimeout":88,"udid":"018433348882859","platformName":"Android","deviceName":"Android","fullReset":false},"app":"/Users/jenkins/.jenkins/jobs/Android5-test-ReleaseIntegtationTests-Demo/workspace/test-Integration-Tests/src/test/resources/testDemo-debug.apk","noReset":true,"newCommandTimeout":88,"udid":"018433348882859","platformName":"Android","deviceName":"018433348882859","fullReset":false,"deviceUDID":"018433348882859","platformVersion":"5.1.1","appPackage":"com.my.testApp","appWaitPackage":"com.my.testApp","appActivity":"com.my.testApp.MainActivity","appWaitActivity":"com.my.targetDem... 
[HTTP] <-- POST /wd/hub/session 200 6192 ms - 1112 
[HTTP] --> GET /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d {} 
[debug]  [MJSONWP] Calling AppiumDriver.getSession() with args:  ["7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d"] 
[debug]  [MJSONWP] Responding to client with driver.getSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"/Users/jenkins/.jenkins/jobs/Android5-test-ReleaseIntegtationTests-Demo/workspace/test-Integration-Tests/src/test/resources/testDemo-debug.apk","noReset":true,"newCommandTimeout":88,"udid":"018433348882859","platformName":"Android","deviceName":"Android","fullReset":false},"app":"/Users/jenkins/.jenkins/jobs/Android5-test-ReleaseIntegtationTests-Demo/workspace/test-Integration-Tests/src/test/resources/testDemo-debug.apk","noReset":true,"newCommandTimeout":88,"udid":"018433348882859","platformName":"Android","deviceName":"018433348882859","fullReset":false,"deviceUDID":"018433348882859","platformVersion":"5.1.1","appPackage":"com.my.testApp","appWaitPackage":"com.my.testApp","appActivity":"com.my.testApp.MainActivity","appWaitActivity":"com.my.targetDem... 
[HTTP] <-- GET /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d 200 5 ms - 1112 
[HTTP] --> GET /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d {} 
[debug]  [MJSONWP] Calling AppiumDriver.getSession() with args:  ["7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d"] 
[debug]  [MJSONWP] Responding to client with driver.getSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"/Users/jenkins/.jenkins/jobs/Android5-test-ReleaseIntegtationTests-Demo/workspace/test-Integration-Tests/src/test/resources/testDemo-debug.apk","noReset":true,"newCommandTimeout":88,"udid":"018433348882859","platformName":"Android","deviceName":"Android","fullReset":false},"app":"/Users/jenkins/.jenkins/jobs/Android5-test-ReleaseIntegtationTests-Demo/workspace/test-Integration-Tests/src/test/resources/testDemo-debug.apk","noReset":true,"newCommandTimeout":88,"udid":"018433348882859","platformName":"Android","deviceName":"018433348882859","fullReset":false,"deviceUDID":"018433348882859","platformVersion":"5.1.1","appPackage":"com.my.testApp","appWaitPackage":"com.my.testApp","appActivity":"com.my.testApp.MainActivity","appWaitActivity":"com.my.targetDem... 
[HTTP] <-- GET /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d 200 3 ms - 1112 
[HTTP] --> POST /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d/timeouts {"type":"implicit","ms":10000} 
[debug]  [MJSONWP] Calling AppiumDriver.timeouts() with args:  ["implicit",10000,"7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d"] 
[debug]  [BaseDriver] Set implicit wait to 10000ms 
[debug]  [MJSONWP] Responding to client with driver.timeouts() result: null 
[HTTP] <-- POST /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d/timeouts 200 3 ms - 76 
[HTTP] --> POST /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d/timeouts {"type":"implicit","ms":1000} 
[debug]  [MJSONWP] Calling AppiumDriver.timeouts() with args:  ["implicit",1000,"7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d"] 
[debug]  [BaseDriver] Set implicit wait to 1000ms 
[debug]  [MJSONWP] Responding to client with driver.timeouts() result: null 
[HTTP] <-- POST /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d/timeouts 200 3 ms - 76 
[HTTP] --> POST /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d/elements {"using":"id","value":"com.my.testApp:id/card_view"} 
[debug]  [MJSONWP] Calling AppiumDriver.findElements() with args:  ["id","com.my.testApp:id/card_view","7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d"] 
[debug]  [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator 
[debug]  [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator 
[debug]  [BaseDriver] Waiting up to 1000 ms for condition 
[debug]  [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.my.testApp:id/card_view","context":"","multiple":true}} 

Appium:1.6.1

io.appium:Java的客戶端:5.0.0-β3

ADB: 1.0.36

附屬功能:

File appDir = new File(System.getProperty("user.dir") + properties.getProperty("appDir")); 
File app = new File(appDir, System.getProperty("appName")); 
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath()); 
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, System.getProperty("platform")); 
capabilities.setCapability(MobileCapabilityType.UDID, System.getProperty("udid")); 
capabilities.setCapability(MobileCapabilityType.NO_RESET, true); 
capabilities.setCapability(MobileCapabilityType.FULL_RESET, false); 
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 88); 
androidDriver = new AndroidDriver(new URL(System.getProperty("appiumUrl")), capabilities); 
androidDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); 

任何想法?

回答

0

重新安裝appium 1.6.1沒有幫助我。

但是我在將appium降級到1.5.3並升級到1.6.1後解決了我的問題。

顯然版本1.5.3拉起了缺少的庫。但爲什麼1.6.1沒有這樣做,我不知道。