1
votes

I am using Appium for Android native app automation on windows machine. All my scenarios are doing good, but sometimes the App gets crashed and Appium stops saying "Didn't get a new command in 60 secs, shutting down".

Note - if explicitly i press any key from keyboard it will get next command to execute while cucumber execution.

I can see Appium is sending request to find the element, but no response has been received. I don't know why this is happening, but the same thing passes without any issue mostly. When this issue happens, Appium closes the app and the next coming scenarios also gets failed.

Someone help to resolve this issue.

This is the Appium server log:

info: Starting App
info: [debug] Attempting to kill all 'uiautomator' processes
info: [debug] Getting all processes with 'uiautomator'
info: [debug] executing cmd: C:\Users\PG106\AppData\Local\Android\sdk\platform-tools\adb.exe -s 300450adeedc3100 shell "ps 'uiautomator'"
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: C:\Users\PG106\AppData\Local\Android\sdk\platform-tools\adb.exe -s 300450adeedc3100 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.paragyte.publicpartnerships.test -e disableAndroidWatchers false
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] Waking up device if it's not alive
info: [debug] Pushing command to appium work queue: ["wake",{}]
info: [debug] [BOOTSTRAP] [debug] Loading json...
info: [debug] [BOOTSTRAP] [debug] json loading complete.
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
info: [debug] executing cmd: C:\Users\PG106\AppData\Local\Android\sdk\platform-tools\adb.exe -s 300450adeedc3100 shell "dumpsys window"

info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"/data/local/tmp","status":0}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":false,"status":0}
info: [debug] Getting device API level
info: [debug] executing cmd: C:\Users\PG106\AppData\Local\Android\sdk\platform-tools\adb.exe -s 300450adeedc3100 shell "getprop ro.build.version.sdk"

info: [debug] Device is at API Level 19
info: [debug] executing cmd: C:\Users\PG106\AppData\Local\Android\sdk\platform-tools\adb.exe -s 300450adeedc3100 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.paragyte.publicpartnerships.test/com.paragyte.publicpartnerships.SplashActivity"

info: [debug] Waiting for pkg "com.paragyte.publicpartnerships.test" and activity "com.paragyte.publicpartnerships.SplashActivity" to be focused
info: [debug] Getting focused package and activity
info: [debug] executing cmd: C:\Users\PG106\AppData\Local\Android\sdk\platform-tools\adb.exe -s 300450adeedc3100 shell "dumpsys window windows"

info: [debug] executing cmd: C:\Users\PG106\AppData\Local\Android\sdk\platform-tools\adb.exe -s 300450adeedc3100 shell "getprop ro.build.version.release"

info: [debug] Device is at release version 4.4.2
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: [debug] Appium session started with sessionId 00bd22a6-7f2e-435b-a6af-53f5bf115a2c
info: <-- POST /wd/hub/session 303 16023.269 ms - 74
info: --> GET /wd/hub/session/00bd22a6-7f2e-435b-a6af-53f5bf115a2c {}

info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"","platformVersion":"4.4.2","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"appiumVersion":"1.6.0","platformName":"Android","platformVersion":"4.4.2","browserName":"","deviceName":"Samsung Galaxy S4 Emulator","app":"D:\Automation\Mobile\apk_files/app-debug.apk","name":"Time 4 Care"},"appiumVersion":"1.6.0","platformName":"Android","deviceName":"300450adeedc3100","app":"D:\Automation\Mobile\apk_files/app-debug.apk","name":"Time 4 Care"},"sessionId":"00bd22a6-7f2e-435b-a6af-53f5bf115a2c"}

info: <-- GET /wd/hub/session/00bd22a6-7f2e-435b-a6af-53f5bf115a2c 200 2.411 ms - 691 {"status":0,"value":{"platform":"LINUX","browserName":"","platformVersion":"4.4.2","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"appiumVersion":"1.6.0","platformName":"Android","platformVersion":"4.4.2","browserName":"","deviceName":"Samsung Galaxy S4 Emulator","app":"D:\Automation\Mobile\apk_files/app-debug.apk","name":"Time 4 Care"},"appiumVersion":"1.6.0","platformName":"Android","deviceName":"300450adeedc3100","app":"D:\Automation\Mobile\apk_files/app-debug.apk","name":"Time 4 Care"},"sessionId":"00bd22a6-7f2e-435b-a6af-53f5bf115a2c"}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"}},"sessionId":"00bd22a6-7f2e-435b-a6af-53f5bf115a2c"}

info: <-- GET /wd/hub/status 200 5.141 ms - 156 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"}},"sessionId":"00bd22a6-7f2e-435b-a6af-53f5bf115a2c"}

info: --> POST /wd/hub/session/00bd22a6-7f2e-435b-a6af-53f5bf115a2c/timeouts/implicit_wait {"ms":0}
info: [debug] Set Android implicit wait to 0ms

info: [debug] Responding to client with success: {"status":0,"value":null,"sessionId":"00bd22a6-7f2e-435b-a6af-53f5bf115a2c"}

info: <-- POST /wd/hub/session/00bd22a6-7f2e-435b-a6af-53f5bf115a2c/timeouts/implicit_wait 200 2.471 ms - 76 {"status":0,"value":null,"sessionId":"00bd22a6-7f2e-435b-a6af-53f5bf115a2c"}

info: --> POST /wd/hub/session/00bd22a6-7f2e-435b-a6af-53f5bf115a2c/appium/device/press_keycode {"keycode":93}
info: [debug] Pushing command to appium work queue: ["pressKeyCode",{"keycode":93,"metastate":null}]

info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"pressKeyCode","params":{"keycode":93,"metastate":null}}

info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: pressKeyCode
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}

info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"00bd22a6-7f2e-435b-a6af-53f5bf115a2c"}
info: <-- POST /wd/hub/session/00bd22a6-7f2e-435b-a6af-53f5bf115a2c/appium/device/press_keycode 200 258.139 ms - 76 {"status":0,"value":true,"sessionId":"00bd22a6-7f2e-435b-a6af-53f5bf115a2c"}

info: [debug] Didn't get a new command in 60 secs, shutting down...
info: Shutting down appium session
info: [debug] Pressing the HOME button

info: [debug] executing cmd: C:\Users\PG106\AppData\Local\Android\sdk\platform-tools\adb.exe -s 300450adeedc3100 shell "input keyevent 3"

info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"OK, shutting down","status":0}
info: [debug] [BOOTSTRAP] [debug] Closed client connection
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
info: [debug] [UIAUTOMATOR STDOUT] Time: 63.073
info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
info: [debug] UiAutomator shut down normally
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] We shut down because no new commands came in

Thanks, Kapil

1
can you format your output? its too hard to read without the line breaksplosco
I have formatted my output. it would be easy to read. Could you please help me to solve this issue?kapil chothe

1 Answers

1
votes

Have you tried setting your desired capability to a higher number? What is it currently set to?

desiredCapabilities.setCapability("newCommandTimeout", 10000);