appium: chromedriver exited unexpectedly when switching to webview on Android real device

I tried with Appium 1.4.10 in Android 4.4.4 and 5.1 , then I updated chromedriver but it still fails to switch contexts

info: --> GET /wd/hub/session/4f75b033-c30f-427d-aa6f-0984919b7390/contexts {}
info: [debug] Getting a list of available webviews
info: [debug] executing cmd: /Users/necoleyu/Library/Android/sdk/platform-tools/adb -s 4d003d1a4d774169 shell "cat /proc/net/unix"
info: [debug] WEBVIEW_19172 mapped to pid 19172
info: [debug] Getting process name for webview
info: [debug] executing cmd: /Users/necoleyu/Library/Android/sdk/platform-tools/adb -s 4d003d1a4d774169 shell "ps"
info: [debug] Parsed pid: 19172 pkg: com.eg.android.MyAppRC
info: [debug] from: u0_a70,19172,1927,865880,140156,ffffffff,00000000,S,com.eg.android.MyAppRC
info: [debug] returning process name: com.eg.android.MyAppRC
info: [debug] Available contexts:
info: [debug] ["WEBVIEW_com.eg.android.MyAppRC"]
info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.eg.android.MyAppRC
info: [debug] Responding to client with success: {"status":0,"value":["NATIVE_APP","WEBVIEW_com.eg.android.MyAppRC"],"sessionId":"4f75b033-c30f-427d-aa6f-0984919b7390"}
info: <-- GET /wd/hub/session/4f75b033-c30f-427d-aa6f-0984919b7390/contexts 200 169.846 ms - 126 {"status":0,"value":["NATIVE_APP","WEBVIEW_com.eg.android.MyAppRC"],"sessionId":"4f75b033-c30f-427d-aa6f-0984919b7390"}
info: --> POST /wd/hub/session/4f75b033-c30f-427d-aa6f-0984919b7390/context {"name":"WEBVIEW_com.eg.android.MyAppRC"}
info: [debug] Getting a list of available webviews
info: [debug] executing cmd: /Users/necoleyu/Library/Android/sdk/platform-tools/adb -s 4d003d1a4d774169 shell "cat /proc/net/unix"
info: [debug] WEBVIEW_19172 mapped to pid 19172
info: [debug] Getting process name for webview
info: [debug] executing cmd: /Users/necoleyu/Library/Android/sdk/platform-tools/adb -s 4d003d1a4d774169 shell "ps"
info: [debug] Parsed pid: 19172 pkg: com.eg.android.MyAppRC
info: [debug] from: u0_a70,19172,1927,865880,140156,ffffffff,00000000,S,com.eg.android.MyAppRC
info: [debug] returning process name: com.eg.android.MyAppRC
info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.eg.android.MyAppRC
info: [debug] ["WEBVIEW_com.eg.android.MyAppRC"]
info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.eg.android.MyAppRC
info: [debug] Connecting to chrome-backed webview
info: Chromedriver: Set chromedriver binary as: /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver
info: Chromedriver: Killing any old chromedrivers, running: ps -ef | grep /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver | grep -v grep |grep -e '--port=9515\(\s.*\)\?$' | awk '{ print $2 }' | xargs kill -15
info: Chromedriver: Successfully cleaned up old chromedrivers
info: Chromedriver: Spawning chromedriver with: /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=9515
info: Chromedriver: [STDOUT] Starting ChromeDriver 2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f) on port 9515
Only local connections are allowed.
info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: JSONWP Proxy: Got response with status 200: {"sessionId":"","status":0,"value":{"build":{"version":"alpha"},"os":{"arch":"x86_64","name":"Mac OS X","version":"10.10.3"}}}
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.eg.android.MyAppRC","androidUseRunningApp":true,"androidDeviceSerial":"4d003d1a4d774169"},"loggingPrefs":{"performance":"ALL"}}}
info: JSONWP Proxy: Got response with status 200: {"sessionId":"3ce09e81fdc10e3047099cec625a4733","status":13,"value":{"message":"unknown error: Device 4d003d1a4d774169 is not online\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d...
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.eg.android.MyAppRC","androidUseRunningApp":true,"androidDeviceSerial":"4d003d1a4d774169"},"loggingPrefs":{"performance":"ALL"}}}
info: JSONWP Proxy: Got response with status 200: {"sessionId":"5ab23b9d57130075fc3f30467b4ee5c9","status":13,"value":{"message":"unknown error: Device 4d003d1a4d774169 is not online\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d...
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.eg.android.MyAppRC","androidUseRunningApp":true,"androidDeviceSerial":"4d003d1a4d774169"},"loggingPrefs":{"performance":"ALL"}}}
info: JSONWP Proxy: Got response with status 200: {"sessionId":"217db5306114ee00e76bc83e566c8f40","status":13,"value":{"message":"unknown error: Device 4d003d1a4d774169 is not online\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d...
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.eg.android.MyAppRC","androidUseRunningApp":true,"androidDeviceSerial":"4d003d1a4d774169"},"loggingPrefs":{"performance":"ALL"}}}
info: JSONWP Proxy: Got response with status 200: {"sessionId":"14a4051e60e1a5bed2636495d3bcc4a2","status":13,"value":{"message":"unknown error: Device 4d003d1a4d774169 is not online\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d...
error: Chromedriver: Chromedriver exited unexpectedly with code null, signal SIGTERM
warn: Chromedriver for context WEBVIEW_com.eg.android.MyAppRC stopped unexpectedly
warn: Chromedriver quit unexpectedly, but it wasn't the active context, ignoring
error: Chromedriver: Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 4d003d1a4d774169 is not online
  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac OS X 10.10.3 x86_64))
    at JWProxy.command$ (lib/proxy.js:149:15)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:294:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at bound (domain.js:254:14)
    at GeneratorFunctionPrototype.runBound (domain.js:267:12)
    at run (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:89:39)
    at /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:100:28
    at process._tickDomainCallback (node.js:381:11)
 { [Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 4d003d1a4d774169 is not online
  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac OS X 10.10.3 x86_64))]
  status: 13,
  value: { message: 'unknown error: Device 4d003d1a4d774169 is not online\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac OS X 10.10.3 x86_64)' },
  httpCode: 200 }

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 3
  • Comments: 21

Most upvoted comments

Try replacing the existing chrome driver

Download chrome driver from the link https://sites.google.com/a/chromium.org/chromedriver/downloads, and place it in the appium folder: …\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win It worked for me.

Hey this problem seems to be solved by setting the capabilities of “recreateChromeDriverSessions” to true as the it will create Chrome driver session every time we switch among from webview. By default, it is false. You can write: capabilities.setCapability(“recreateChromeDriverSessions”, true);