Chromedriver error when trying to run test on Android Emulator

664 views
Skip to first unread message

theghostwalker

unread,
Jun 30, 2014, 6:32:07 PM6/30/14
to appium-...@googlegroups.com

Hi,
I am using the following configuration:
Appium version: 1.1.0
Chrome apk
Android Emulator:API 18

Setting the DesiredCapabilities object as follows:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("device","Android");
capabilities.setCapability(CapabilityType.VERSION, "4.3");
capabilities.setCapability(CapabilityType.PLATFORM, "Android");
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Chrome");
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.get("http://test.com/m");
driver.manage().timeouts().implicitlyWait(90, TimeUnit.SECONDS);

When I try to run my tests..following is the server log:
nfo: Creating Chrome session
info: Ensuring Chromedriver exists
info: Killing any old chromedrivers, running: ps -e | grep /usr/local/lib/node_modules/appium/build/chromedriver/mac/chromedriver | grep -v grep |grep -e '--port=9515$' | awk '{ print $1 }' | xargs kill -15
info: Successfully cleaned up old chromedrivers
info: Spawning chromedriver with: /usr/local/lib/node_modules/appium/build/chromedriver/mac/chromedriver
info: [CHROMEDRIVER] Starting ChromeDriver (v2.9.248307) on port 9515
info: 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":"emulator-5554"}}}}
info: Could not connect yet; retrying
info: 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":"emulator-5554"}}}}
error: Chromedriver create session did not work. Status was 200 and body was {"sessionId":"3525c680584061f42990ab6681df2716","status":100,"value":{"message":"chrome not reachable\n (Driver info: chromedriver=2.9.248307,platform=Mac OS X 10.8.3 x86_64)"}}
info: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Did not get session redirect from Chromedriver
info: Error: Did not get session redirect from Chromedriver
at null. (/usr/local/lib/node_modules/appium/lib/devices/android/chromedriver.js:195:12)
at Request._callback (/usr/local/lib/node_modules/appium/lib/devices/common.js:104:5)
at Request.self.callback (/usr/local/lib/node_modules/appium/node_modules/request/request.js:121:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request. (/usr/local/lib/node_modules/appium/node_modules/request/request.js:985:14)
at Request.EventEmitter.emit (events.js:117:20)
at IncomingMessage. (/usr/local/lib/node_modules/appium/node_modules/request/request.js:936:12)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:919:16
at process._tickCallback (node.js:419:13)
info: 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}
POST /wd/hub/session 500 75814ms - 242b

It launches the Chrome browser but is enable to fetch the URL.I have my environment system path set to chromedriver
What can be the issue here.?

Chetan

unread,
Jul 2, 2014, 2:17:54 AM7/2/14
to appium-...@googlegroups.com
facing same issue ?
Any resolution ?

Isaac Murchie

unread,
Jul 2, 2014, 6:59:26 PM7/2/14
to Chetan, appium-...@googlegroups.com
If you run ChromeDriver manually does it work?

In one terminal window/tab:
chromedriver --verbose --log-path=./test.log

In another, run a simple test:
from selenium.webdriver.remote.webdriver import WebDriver

caps = {
  "chromeOptions": {
    "androidPackage": "com.android.chrome",
    "androidDeviceSerial": "emulator-5554"
  }
}

driver = WebDriver(command_executor='http://127.0.0.1:9515', desired_capabilities=caps)
driver.get('http://www.google.com')
driver.quit()


--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/d/optout.

chetan zope

unread,
Jul 15, 2014, 12:26:04 AM7/15/14
to Isaac Murchie, appium-...@googlegroups.com
Sorry for the late reply .

It worked for me after changing the chrome apk.

Worked on emulator using chrome apk(v35) and chrome driver of version 2.10.

Surender Kumar

unread,
Jul 18, 2014, 2:55:05 AM7/18/14
to appium-...@googlegroups.com, is...@saucelabs.com
Hi,

Chrome opens up on emulator 4.3(using apk v35 and chromedriver 2.10) but does not navigate to URL.After chrome opens on emulator,no activity occurs after that...

Below is the appium log...


> Killed Node Server.
> Node Server Process Ended
> Starting Node Server
> info: Welcome to Appium v1.2.0 (REV e53f49c706a25242e66d36685c268b599cc18da5)
> ERROR: debug: Non-default server args: {"address":"127.0.0.1","logNoColors":true,"avd":"Emulator18","androidDeviceReadyTimeout":"10","deviceName":"Android","platformName":"Android","platformVersion":"18","automationName":"Appium","browserName":"Chrome"}
> info: Appium REST http interface listener started on 127.0.0.1:4723
> info: LogLevel: debug
> info: --> POST /wd/hub/session {"desiredCapabilities":{"autoWebviewTimeout":2,"autoWebview":true,"platformName":"Android","deviceName":"Android Emulator"}}
> ERROR: debug: Appium request initiated at /wd/hub/session
> ERROR: debug: Request received with params: {"desiredCapabilities":{"autoWebviewTimeout":2,"autoWebview":true,"platformName":"Android","deviceName":"Android Emulator"}}
> ERROR: debug: Looks like we want chrome on android
> ERROR: debug: Creating new appium session c5ba039c-fe17-4e95-a44f-7c84d891dc97
> ERROR: debug: Preparing device for session
> ERROR: debug: Not checking whether app is present since we are assuming it's already on the device
> ERROR: debug: Checking whether adb is present
> ERROR: debug: Using adb from E:\Softwares\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe
> ERROR: debug: Trying to find Emulator18 emulator
> ERROR: debug: Getting connected emulators
> ERROR: debug: Getting connected devices...
> ERROR: debug: executing: "E:\Softwares\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe" devices
> ERROR: debug: 1 device(s) connected
> ERROR: debug: 1 emulator(s) connected
> ERROR: debug: Sending telnet command to device: avd name
> ERROR: debug: Getting running emulator port
> ERROR: debug: Socket connection to device created
> ERROR: debug: Socket connection to device ready
> ERROR: debug: Telnet command got response: Emulator18
> ERROR: debug: Found emulator Emulator18 in port 5554
> ERROR: debug: Setting device id to emulator-5554
> ERROR: debug: Did not launch AVD because it was already running.
> ERROR: debug: Waiting for device to be ready and to respond to shell commands (timeout = 10)
> ERROR: debug: executing: "E:\Softwares\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe" -s emulator-5554 wait-for-device
> ERROR: debug: executing: "E:\Softwares\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe" -s emulator-5554 shell "echo 'ready'"
> ERROR: debug: Starting logcat capture
> ERROR: debug: Pushing unlock helper app to device...
> ERROR: debug: executing: "E:\Softwares\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe" -s emulator-5554 install "D:\AppiumForWindows-1.2.0.0\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
> ERROR: debug: executing: "E:\Softwares\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe" -s emulator-5554 shell "dumpsys window"
> ERROR: debug: Writing dumpsys output to D:\AppiumForWindows-1.2.0.0\Appium\node_modules\appium\.dumpsys.log
> ERROR: debug: Screen already unlocked, continuing.
> ERROR: debug: Creating Chrome session
> ERROR: debug: Ensuring Chromedriver exists
> ERROR: 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))
> ERROR: debug: No old chromedrivers seemed to exist
> ERROR: debug: Spawning chromedriver with: D:\AppiumForWindows-1.2.0.0\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
> ERROR: debug: [CHROMEDRIVER] Starting ChromeDriver (v2.10.267521) on port 9515
> ERROR: Only local connections are allowed.
> ERROR: 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":"emulator-5554"}}}}


Please help me.

Thanks
Surender

Isaac Murchie

unread,
Jul 18, 2014, 2:21:21 PM7/18/14
to Surender Kumar, appium-...@googlegroups.com
I would play around with my Chrome apk. Not all work with the emulator, not all work with ChromeDriver.
Reply all
Reply to author
Forward
0 new messages