Appium failed to launch Chrome while testing webview on an Android App

Issue Summary

I have an Android App which has a webview page needed to be tested. In our app, this webview page actually can be launched in two different activities, say Activity A and Activity B. When I use Appium to test the webview, it’s perfectly fine with testing in Activity A. However, in Activity B, I consistently got the “chrome not reachable” exception while trying to launch the webview testing. Please see the attached truncated logs below.

Appium Logs:

  1. In Activity A (com.cool.launcher.ActivityA):
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.cool.launcher","androidUseRunningApp":true,"androidDeviceSerial":"G070GV1161460462"}}}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"51ba37cc09ff814e68379ae421672597","status":0,"value":{"acceptSslCerts":true,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f)"},"cssSelectorsEnabled":true,"databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":true,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"pageLoadStrategy":"normal","platform":"ANDROID","rotatable":false,"takesHeapSnapshot":true,"takesScreenshot":true,"unexpectedAlertBehaviour":"","version":"55.0.2883.91","webStorageEnabled":true}}
  1. In Activity B (com.cool.other.ActivityB):
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.cool.launcher","androidUseRunningApp":true,"androidDeviceSerial":"G070GV1161460462"}}}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"b84ab25a4119c370b873b71206245963","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.11.6 x86_64)"}}

Environment

  • Appium version: 1.6.5
  • OS to run Appium: MacOS 10.11.6
  • Android version: 5.1.1

Capabilities

[Appium] Creating new AndroidDriver (v1.20.0) session
[Appium] Capabilities:
[Appium]   appPackage: 'com.cool.launcher'
[Appium]   appActivity: 'ActivityA'
[Appium]   newCommandTimeout: 180
[Appium]   appWaitActivity: 'ActivityA'
[Appium]   browserName: 'android'
[Appium]   platformName: 'Android'
[Appium]   udid: 'G070GV1161460462'
[Appium]   deviceName: 'defaultDevice'
[Appium]   version: ''
[Appium]   platform: 'ANDROID'

Could anybody please help me to locate the root cause of this issue?

Thanks,

Check this: https://github.com/appium/appium/issues/89582