Chrome browser not opening on Android Lollipop 5.0.2

While automating chrome browser on Android Lollipop 5.0.2 I am getting “A new session could not be created” error message.

Appium version : 1.3.4.1
chrome driver : 2.13
Java client : 2.1.0

Appium log is as given below

Starting Node Server
info: Welcome to Appium v1.3.4 (REV c8c79a85fbd6870cd6fc3d66d038a115ebe22efe)
info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true,"deviceName":"410087b6d38ab000","platformName":"Android","platformVersion":"16","automationName":"Selendroid","browserName":"Chrome"}
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"newCommandTimeout":50,"automationName":"Appium","platformVersion":"5.0.2","deviceName":"TA933089DB","platformName":"Android","browserName":"Chrome","chrome.switches":["--disable-logging","--silent","--log-level 3","--disable-popup-blocking"]}}
info: Client User-Agent string: Apache-HttpClient/4.3.4 (java 1.5)
warn: Converting cap chrome.switches to string, since it was an object. This might be a user error. Original value was: ["--disable-logging","--silent","--log-level 3","--disable-popup-blocking"]
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. : chrome.switches
info: Set mode: Proxying straight through to Chromedriver
info: [debug] Looks like we want chrome on android
info: [debug] Creating new appium session 7fa838a2-72a3-4f99-8b3e-18313b2a83f2
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: [debug] Checking whether adb is present
info: [debug] Using adb from C:\Users\boorap\android-sdks\platform-tools\adb.exe
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device TA933089DB
info: [debug] Setting device id to TA933089DB
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB wait-for-device
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Pushing unlock helper app to device...
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB install "C:\Users\GajeshwarP\Downloads\AppiumForWindows-1.3.4.1\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB shell "dumpsys window"
info: Unlocking screen
info: [debug] Screen is locked, trying to unlock
info: [debug] Getting device API level
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 21
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n io.appium.unlock/.Unlock"
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB shell "dumpsys window"
info: [debug] Screen is locked, trying to unlock
info: [debug] Getting device API level
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 21
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n io.appium.unlock/.Unlock"
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB shell "dumpsys window"
info: [debug] Screen is unlocked, continuing
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device...
info: [debug] executing cmd: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB push "C:\\Users\\GajeshwarP\\Downloads\\AppiumForWindows-1.3.4.1\\Appium\\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: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB shell "ps 'uiautomator'"
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: C:\Users\boorap\android-sdks\platform-tools\adb.exe -s TA933089DB shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap
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] [BOOTSTRAP] [debug] Loading json...
info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
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] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"\/data\/local\/tmp"}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Creating Chrome session
info: [debug] Set chromedriver binary as: C:\Users\GajeshwarP\Downloads\AppiumForWindows-1.3.4.1\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
info: [debug] Ensuring Chromedriver exists
info: [debug] Killing any old chromedrivers, running: FOR /F "usebackq tokens=5" %a in (`netstat -nao ^| findstr /R /C:"9515 "`) do (FOR /F "usebackq" %b in (`TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe`) do (IF NOT %b=="" TASKKILL /F /PID %b))
info: [debug] No old chromedrivers seemed to exist
info: [debug] Spawning chromedriver with: C:\Users\GajeshwarP\Downloads\AppiumForWindows-1.3.4.1\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
info: [debug] [CHROMEDRIVER] Starting ChromeDriver 2.13.307647 (5a7d0541ebc58e69994a6fb2ed930f45261f3c29) on port 9515
Only local connections are allowed.
info: [debug] Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/session","method":"POST","json":{"sessionId":null,"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"TA933089DB"}}}}
info: [debug] [BOOTSTRAP] [debug] Emitting system alert message
info: [debug] Emitting alert message...
info: [debug] [BOOTSTRAP] [debug] Emitting system alert message
info: [debug] Emitting alert message...
error: Chromedriver create session did not work. Status was 200 and body was {"sessionId":"2c5653530f247422617dec65b014b394","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.13.307647 (5a7d0541ebc58e69994a6fb2ed930f45261f3c29),platform=Windows NT 6.1 SP1 x86)"}}
info: [debug] Error: Did not get session redirect from Chromedriver
    at null.<anonymous> (C:\Users\GajeshwarP\Downloads\AppiumForWindows-1.3.4.1\Appium\node_modules\appium\lib\devices\android\chromedriver.js:222:12)
    at Request._callback (C:\Users\GajeshwarP\Downloads\AppiumForWindows-1.3.4.1\Appium\node_modules\appium\lib\devices\common.js:121:5)
    at Request.self.callback (C:\Users\GajeshwarP\Downloads\AppiumForWindows-1.3.4.1\Appium\node_modules\appium\node_modules\request\request.js:121:22)
    at Request.EventEmitter.emit (events.js:98:17)
    at Request.<anonymous> (C:\Users\GajeshwarP\Downloads\AppiumForWindows-1.3.4.1\Appium\node_modules\appium\node_modules\request\request.js:985:14)
    at Request.EventEmitter.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (C:\Users\GajeshwarP\Downloads\AppiumForWindows-1.3.4.1\Appium\node_modules\appium\node_modules\request\request.js:936:12)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickDomainCallback (node.js:459:13)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Did not get session redirect from Chromedriver)","origValue":"Did not get session redirect from Chromedriver"},"sessionId":null}
info: <-- POST /wd/hub/session 500 91236.172 ms - 214 

Please help to solve this issue as I am blocked on Android Lollipop for browser automation.

Thanks in advance.

Hi ,

I am beginner to appium . I am trying to automate the chome browser in android mobile ( 5.0.1 version ) .

But i am getting the below error while running the below code . some times the browser will not be started . some times after opening the browser , i am facing the below error . kindly help me out.

DesiredCapabilities capabilities=DesiredCapabilities.android();
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME,“Browser”); capabilities.setCapability(MobileCapabilityType.PLATFORM,Platform.ANDROID);
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,“Android”);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,“Android Emulator”);
capabilities.setCapability(MobileCapabilityType.VERSION,“5.0.1”);
URL url= new URL(“http://127.0.0.1:4723/wd/hub”);


error :slight_smile:

2016-07-16 20:58:16:889 - info: [debug] Cleaning up appium session
2016-07-16 20:58:16:889 - error: Failed to start an Appium session, err was: Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device emulator-5554 is not online
(Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64))
2016-07-16 20:58:16:890 - info: [debug] Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device emulator-5554 is not online
(Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64))
at JWProxy.command$ (lib/proxy.js:133:15).