Ask to sign in when Chrome starts - test will fail

Hi everyone!

I have a setup with several different android devices - everyone of them has an own Appium server, running on its own port and has its own bootstrap and chromedriver port. Selenium Grid is used to execute my tests on all devices.

Everything works quite well TBH. Thumbs up for Appium! :smile:

My problem is, that when Chrome is opened on my Google Nexus 7, Chrome asks me to sign in. This will timeout the tests, even if I sign in “manually”.
Singing in doesn’t change it - always getting asked at the beginning of a session.

Even when I removed the Google Account from the device, Chrome is asking me to sign in.
This is no problem at other devices (e.g. Samsung Galaxy S2 to S5).

I think this isn’t a Appium problem, rather a Google problem :wink: But I hope one of you can put me in the right direction, or asks me the right questions.

Here are some logs from Appium

info: --> POST /wd/hub/session {"desiredCapabilities":{"count":1,"browserName":"Chrome","platformName":"ANDROID","udid":"015d4b340c340a02","deviceName":""}}
info: Client User-Agent string: Apache-HttpClient/4.4.1 (Java/1.8.0_45)
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : count
info: Set mode: Proxying straight through to Chromedriver
info: [debug] Looks like we want chrome on android
info: [debug] Creating new appium session 2f418ef8-f4d5-4e4e-99f1-3748b42ee7c6
info: [debug] Checking whether adb is present
info: [debug] Using adb from /Users/xadmin/deviceLab/android-sdk-macosx/platform-tools/adb
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it's already on the device
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: /Users/xadmin/deviceLab/android-sdk-macosx/platform-tools/adb devices
info: [debug] 6 device(s) connected
info: Found device 015d4b340c340a02
info: [debug] Setting device id to 015d4b340c340a02
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: /Users/xadmin/deviceLab/android-sdk-macosx/platform-tools/adb -s 015d4b340c340a02 wait-for-device
info: [debug] executing cmd: /Users/xadmin/deviceLab/android-sdk-macosx/platform-tools/adb -s 015d4b340c340a02 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Pushing unlock helper app to device...
info: [debug] executing cmd: /Users/xadmin/deviceLab/android-sdk-macosx/platform-tools/adb -s 015d4b340c340a02 install "/Users/xadmin/deviceLab/device-whisperer/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk"
info: --> GET /wd/hub/status {}
error: Trying to proxy a session command without session id
info: [debug] executing cmd: /Users/xadmin/deviceLab/android-sdk-macosx/platform-tools/adb -s 015d4b340c340a02 shell "dumpsys window"
info: [debug] Screen already unlocked, continuing.
info: [debug] Forwarding system:40734 to device:4724
info: [debug] executing cmd: /Users/xadmin/deviceLab/android-sdk-macosx/platform-tools/adb -s 015d4b340c340a02 forward tcp:40734 tcp:4724
info: [debug] Pushing appium bootstrap to device...
info: [debug] executing cmd: /Users/xadmin/deviceLab/android-sdk-macosx/platform-tools/adb -s 015d4b340c340a02 push "/Users/xadmin/deviceLab/device-whisperer/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar" /data/local/tmp/
info: Starting App
info: [debug] Attempting to kill all 'uiautomator' processes
info: [debug] Getting all processes with 'uiautomator'
info: [debug] executing cmd: /Users/xadmin/deviceLab/android-sdk-macosx/platform-tools/adb -s 015d4b340c340a02 shell "ps 'uiautomator'"
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: /Users/xadmin/deviceLab/android-sdk-macosx/platform-tools/adb -s 015d4b340c340a02 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.android.chrome -e disableAndroidWatchers false
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
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] [BOOTSTRAP] [debug] Loading json...
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
info: [debug] [BOOTSTRAP] [debug] Client connected
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] dataDir set to: /data/local/tmp
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"\/data\/local\/tmp","status":0}
info: Chromedriver: Set chromedriver binary as: /Users/xadmin/deviceLab/device-whisperer/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver
info: Chromedriver: Killing any old chromedrivers, running: ps -ef | grep /Users/xadmin/deviceLab/device-whisperer/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver | grep -v grep |grep -e '--port=40735\(\s.*\)\?$' | awk '{ print $2 }' | xargs kill -15
info: Chromedriver: Successfully cleaned up old chromedrivers
info: Chromedriver: Spawning chromedriver with: /Users/xadmin/deviceLab/device-whisperer/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=40735
info: Chromedriver: [STDOUT] Starting ChromeDriver 2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f) on port 40735
Only local connections are allowed.
info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:40735/wd/hub/status] with no body
info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:40735/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.4"}}}
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:40735/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"015d4b340c340a02"}}}

And after some time, this is happening

info: JSONWP Proxy: Got response with status 200: {"sessionId":"d6dea76b3931d4c079cdb51ef784f728","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac ...
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:40735/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"015d4b340c340a02"}}}
info: JSONWP Proxy: Got response with status 200: {"sessionId":"220dcbbeed446b01e88eb88e64e70cc8","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac ...
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:40735/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"015d4b340c340a02"}}}
info: JSONWP Proxy: Got response with status 200: {"sessionId":"520c05e24f345a37a73924f3e373867f","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac ...
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:40735/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"015d4b340c340a02"}}}

info: JSONWP Proxy: Got response with status 200: {"sessionId":"6cc98062eefae92a022b335347f4139f","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac ...
error: Chromedriver: Chromedriver exited unexpectedly with code null, signal SIGTERM
info: Chromedriver stopped unexpectedly on us, shutting down then calling back up with the on-die callback

error: Chromedriver: Error: An error occurred (Original error: chrome not reachable
  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac OS X 10.10.4 x86_64))
    at JWProxy.command$ (lib/proxy.js:148:15)
    at tryCatch (/Users/xadmin/deviceLab/device-whisperer/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/xadmin/deviceLab/device-whisperer/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:294:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/xadmin/deviceLab/device-whisperer/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/Users/xadmin/deviceLab/device-whisperer/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 (/Users/xadmin/deviceLab/device-whisperer/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:89:39)
    at /Users/xadmin/deviceLab/device-whisperer/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 error occurred (Original error: chrome not reachable
  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac OS X 10.10.4 x86_64))]
  status: 100,
  value: { message: 'chrome not reachable\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac OS X 10.10.4 x86_64)' },
  httpCode: 200 }

info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: An error occurred (Original error: chrome not reachable
  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac OS X 10.10.4 x86_64))

info: [debug] Error: An error occurred (Original error: chrome not reachable
  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac OS X 10.10.4 x86_64))
    at JWProxy.command$ (lib/proxy.js:148:15)
    at tryCatch (/Users/xadmin/deviceLab/device-whisperer/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/xadmin/deviceLab/device-whisperer/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:294:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/xadmin/deviceLab/device-whisperer/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/Users/xadmin/deviceLab/device-whisperer/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 (/Users/xadmin/deviceLab/device-whisperer/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:89:39)
    at /Users/xadmin/deviceLab/device-whisperer/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)

info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: An error occurred (Original error: chrome not reachable\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac OS X 10.10.4 x86_64)))","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac OS X 10.10.4 x86_64)"},"httpCode":200,"origValue":"An error occurred (Original error: chrome not reachable\n  (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac OS X 10.10.4 x86_64))"},"sessionId":null}
info: <-- POST /wd/hub/session 500 254682.133 ms - 662 
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: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] Test results for UiAutomatorTestRunner=.
info: [debug] [UIAUTOMATOR STDOUT] Time: 253.118
info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
info: [debug] UiAutomator shut down normally
info: [debug] executing cmd: /Users/xadmin/deviceLab/android-sdk-macosx/platform-tools/adb -s 015d4b340c340a02 shell "am force-stop com.android.chrome"
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] Cleaning up appium session

You need to update Chrome :slight_smile:

I Am also facing the same problem is it resolved, if yes please share the details.

Thanks
Nageswar