Getting Chromedriver error when trying to run test on a connected Android Device

4,042 views
Skip to first unread message

Nason Zia

unread,
Jan 15, 2014, 4:41:59 PM1/15/14
to appium-...@googlegroups.com
I have the Android phone connected to window 7 and have the chrome app install in the device. When running the test i'm get the following error even though I have the Chromedriver installed in the C:\Users\<my machine name>\selenium and environment variable is set to that path. 


info: Welcome to Appium v0.13.0
info: Appium REST http interface listener started on 127.0.0.1:4723
   info  - socket.io started
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"app":"chrome","dev
ice":"Android"}}
info: Looks like we want chrome on android
info: Creating new appium session 6214d93f-23d5-4217-a76b-b4a258193789
info: Ensuring Chromedriver exists
info: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Could not find chromed
river, is it on PATH?
info: Responding to client with error: {"status":33,"value":{"message":"A new se
ssion could not be created. (Original error: Could not find chromedriver, is it
on PATH?)","origValue":"Could not find chromedriver, is it on PATH?"},"sessionId
":null}
POST /wd/hub/session 500 136ms - 236b


And I'm running this sample code----------

import java.net.URL;
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;


public class Test_Android {
@Test
public void testAndroid() throws MalformedURLException {
//SeHelper se = new SeHelper(); 
//setup the web driver and launch the webview app.
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("app", "chrome");
desiredCapabilities.setCapability("device", "Android");
URL url = new URL("http://127.0.0.1:4723/wd/hub");
RemoteWebDriver remoteWebDriver = new RemoteWebDriver(url, desiredCapabilities);

// Navigate to the page and interact with the elements on the guinea-pig page using id.
remoteWebDriver.get("http://saucelabs.com/test/guinea-pig");
WebElement div = remoteWebDriver.findElement(By.id("i_am_an_id"));
Assert.assertEquals("I am a div", div.getText()); //check the text retrieved matches expected value
remoteWebDriver.findElement(By.id("comments")).sendKeys("My comment"); //populate the comments field by id.

//close the app.
remoteWebDriver.quit();
}
}


Thanks
Nason


Nason Zia

unread,
Jan 15, 2014, 6:50:56 PM1/15/14
to appium-...@googlegroups.com
Hi all,

I've solved the above problem. Noe I'm getting the below error-------



info: Welcome to Appium v0.13.0
info: Appium REST http interface listener started on 127.0.0.1:4723
   info  - socket.io started
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"app":"chrome","dev
ice":"Android"}}
info: Looks like we want chrome on android
info: Creating new appium session 2b6449ec-3920-4977-b38a-1589dceb5de9
info: Ensuring Chromedriver exists
info: Spawning chromedriver with: C:\Users\NZIA\selenium\chromedriver.exe
info: [CHROMEDRIVER] Starting ChromeDriver (v2.3) on port 9515
info: Creating Chrome session
info: Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/sessio
n","method":"POST","json":{"sessionId":null,"desiredCapabilities":{"chromeOption
s":{"androidPackage":"com.android.chrome"}}}}
error: Chromedriver create session did not work. Status was 200 and body was {"s
essionId":"6fc75da5d95acee43ee87957afbe47fa","status":13,"value":{"message":"unk
nown error: Failed to set command line file /data/local/chrome-command-line on d
evice HT35WW900130\n  (Driver info: chromedriver=2.3,platform=Windows NT 6.1 SP1
 x86_64)"}}
info: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Did not get session re
direct from Chromedriver
info: Responding to client with error: {"status":33,"value":{"message":"A new se
ssion could not be created. (Original error: Did not get session redirect from C
hromedriver)","origValue":"Did not get session redirect from Chromedriver"},"ses
sionId":null}
POST /wd/hub/session 500 2227ms - 242b

Jonathan Lipps

unread,
Jan 15, 2014, 8:01:56 PM1/15/14
to Nason Zia, appium-...@googlegroups.com
this is fixed in master. just wait for the next release.

--
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/groups/opt_out.

Nason Zia

unread,
Jan 16, 2014, 6:52:57 PM1/16/14
to appium-...@googlegroups.com, Nason Zia
When might we have that available?

daniel ben yossef

unread,
Jan 22, 2014, 10:38:52 AM1/22/14
to appium-...@googlegroups.com, Nason Zia
i would love to know as well

Khushboo Kaur

unread,
Jan 31, 2014, 8:11:05 AM1/31/14
to appium-...@googlegroups.com

I am also trying to automate the Chrome browser on Android devices. I have also followed the same two error conditions mentioned by Nason Zia. 
Regarding the first issue, even after adding the path of Chromedriver, the Node.js logs:
error: Failed to start an Appium session, err was: Error: Could not find chromed
river, is it on PATH?
To overcome this, I copied ChromeDriver.exe in the folder where Nodejs is installed. After this, I am having the second mentioned error.

error: Chromedriver create session did not work. Status was 200 and body was {"s
essionId":"6fc75da5d95acee43ee87957afbe47fa","status":13,"value":{"message":"unk
nown error: Failed to set command line file /data/local/chrome-command-line on d
evice HT35WW900130\n  (Driver info: chromedriver=2.8,platform=Windows NT 6.1 SP1
 x86_64)"}}

The chrome browser is launched in the Emulator but the website is not launched and further automation is also halted. How can I resolve this?

Jonathan Lipps

unread,
Jan 31, 2014, 12:25:22 PM1/31/14
to Khushboo Kaur, appium-...@googlegroups.com
your device needs to be rooted

Khushboo Kaur

unread,
Jan 31, 2014, 1:15:16 PM1/31/14
to appium-...@googlegroups.com
Jonathan, I have tried executing on emulator. Should emulator be also rooted?

Jonathan Lipps

unread,
Jan 31, 2014, 4:00:24 PM1/31/14
to Khushboo Kaur, appium-...@googlegroups.com
you get the same error on an emulator?

On Jan 31, 2014, at 10:15 AM, Khushboo Kaur <khushb...@3pillarglobal.com> wrote:

> Jonathan, I have tried executing on emulator. Should emulator be also rooted?
>

Khushboo Kaur

unread,
Feb 1, 2014, 12:03:50 AM2/1/14
to appium-...@googlegroups.com
Yes. I got these appium logs when I have executed the test script on Emulator.
How can I resolve the error?

Khushboo Kaur

unread,
Feb 3, 2014, 2:21:32 AM2/3/14
to appium-...@googlegroups.com
I have downloaded the latest release appium 14.2 and executed the same code again on ARM Emulator (API Level 16). I got these logs:
info: Welcome to Appium v0.14.2
info: Appium REST http interface listener started on 127.0.0.1:4723
   info  - socket.io started
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"app":"chrome","dev
ice":"Android"}}
info: Looks like we want chrome on android
info: Creating new appium session f6c89a7c-3f4d-40d4-86ce-b82cdfacff17
info: Ensuring Chromedriver exists
debug: Pushing unlock helper app to device...
debug: executing: adb install C:\Users\khushboo.kaur\Documents\AppiumForWindows-
0.14.2\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk
debug: executing: adb shell "dumpsys window"
info: Writing dumpsys output to C:\Users\khushboo.kaur\Documents\AppiumForWindow
s-0.14.2\Appium\node_modules\appium\.dumpsys.log
debug: Screen already unlocked, continuing.
info: Killing any old chromedrivers
info: No old chromedrivers seemed to exist
info: Spawning chromedriver with: C:\Program Files (x86)\nodejs\chromedriver.exe

info: [CHROMEDRIVER] Starting ChromeDriver (v2.8.241075) on port 9515
info: Creating Chrome session
info: Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/sessio
n","method":"POST","json":{"sessionId":null,"desiredCapabilities":{"chromeOption
s":{"androidPackage":"com.android.chrome"}}}}
error: Chromedriver create session did not work. Status was 200 and body was {"s
essionId":"730794bde3468bedc058dce9972ed044","status":100,"value":{"message":"ch
rome not reachable\n  (Driver info: chromedriver=2.8.241075,platform=Windows NT
6.1 SP1 x86_64)"}}
info: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Did not get session re
direct from Chromedriver
info: Responding to client with error: {"status":33,"value":{"message":"A new se
ssion could not be created. (Original error: Did not get session redirect from C
hromedriver)","origValue":"Did not get session redirect from Chromedriver"},"ses
sionId":null}
POST /wd/hub/session 500 52440ms - 242b

Am I missing any setting?

Thanks.

Khushboo Kaur

unread,
Feb 4, 2014, 4:13:39 AM2/4/14
to appium-...@googlegroups.com
I am automating the chrome browser on AVD API Level 18 ARM Emulator. Following are the hardware config for Emulator:
hw.battery=yes
Heap Size=64
Ram size=768
hw.sdcard=no
I have tried automating Chrome browser version 18.0.xxxxxx and 31.0.1650.59
Chrome Driver version tested: 2.8, 2.9, 2.2 (http://chromedriver.storage.googleapis.com/index.html)
Unlock.spk was successfully installed in the emulator. I have tested this separately also through adb command Line.
Appium launches the chrome browser but does not continue working with any of the websites. Instead the address bar has 'data:' written
The android Emulator is booted, up and running, connected and online.

Jonathan Lipps

unread,
Feb 3, 2014, 12:49:39 PM2/3/14
to Khushboo Kaur, appium-...@googlegroups.com
what version of chrome is on the emulator? is the emulator booted and running and adb working?

Khushboo Kaur

unread,
Feb 5, 2014, 10:23:45 AM2/5/14
to appium-...@googlegroups.com
I could find out that this is not an Appium Issue but Chrome Driver problem. I simply started ChromeDriver to automate the chrome browser on android ARM emulator. Chrome Driver version 2.8 and 2.9 were unable to automate chrome apk (version 31.xx) on android emulator. I mentioned the error logs above. However when I used ChromeDriver 2.3 and Chrome apk version 29.xx, the chrome browser was automated and I could not see the error.

Rajeswari Thangavelu

unread,
Feb 7, 2014, 6:14:18 PM2/7/14
to appium-...@googlegroups.com
Hi Khushboo Kaur,

My Appium is stuck with the following log.

info: Welcome to Appium v0.14.2
info: Appium REST http interface listener started on 127.0.0.1:4723
   info  - socket.io started
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"platform":"Windows
","app":"Chrome","device":"Android","version":"4.3"}}
info: Looks like we want chrome on android
info: Creating new appium session 233306b3-86c3-48b0-af3c-191ae3328619
info: Ensuring Chromedriver exists
debug: Pushing unlock helper app to device...
debug: executing: adb install C:\Etouch\Software\Appium\Appium\node_modules\appi
um\build\unlock_apk\unlock_apk-debug.apk
warn:  killed=false, code=1, signal=null

Do we have to keep the android emulator unlock or leave it like that? Please advice

After sometime, it says that "error: Failed to start an Appium session, err was: Error: Requested a new sessio n but one was in progress"

Please let me know if anyone has any idea on this




Thanks,
Raji

Khushboo Kaur

unread,
Feb 8, 2014, 3:14:32 AM2/8/14
to appium-...@googlegroups.com
I came across this exception when I intended to start two appium servers. This surely indicates that you are trying to start appium server whereas one appium server is already in progress on your OS. Check the background process to be sure. Also use any uitlity program/software like TCPView to know if the port 4723 is free.
I think adb behaves flabby sometimes so its better to unlock the emulator. Execute 'adb devices' to check whether the device is active and online. Sometimes the emulators are shown connected but they go offline so adb does not work in this case.

Rajeswari Thangavelu

unread,
Feb 10, 2014, 8:01:07 PM2/10/14
to appium-...@googlegroups.com
Thanks Khushboo,

That problem is fixed.


"However when I used ChromeDriver 2.3 and Chrome apk version 29.xx, the chrome browser was automated and I could not see the error."

 Just wanted to know from where did you download Chrome apk version 29.xx ? Is this for emulator? Is it working fine with Appium now?

I am trying to connect Appium with Chrome in Android emulator (ARM, 4.3) for last three days. No success yet, One or the other problem,
The recent one is "Did not get session redirect from Chromedriver".

As per your thread I have install chromedriver 2.3. But couldn't get Chrome apk 29

Looks like you have resolved this. Could you send me the details please? I have very less information related on this when I google it.

Thanks!!!
Raji

Khushboo Kaur

unread,
Feb 11, 2014, 2:43:29 AM2/11/14
to appium-...@googlegroups.com
I could get the Chrome APK version 29 from my Lead. I have attached the chrome, you can try this.

Rajeswari Thangavelu

unread,
Feb 12, 2014, 4:39:29 PM2/12/14
to Khushboo Kaur, appium-...@googlegroups.com
Thanks a lot Khushboo again,

Now the appium is connecting with Chrome. But the chrome is not showing anything in emulator. It is not responding even I google manually.

Am I missing anything in Chrome install on Android emulator?

Here is the log from Appium

POST /wd/hub/session/ebe57e3c76983d30a3ffc3c81a6dae92/element 200 1389ms - 125b
debug: Appium request initiated at /wd/hub/session/ebe57e3c76983d30a3ffc3c81a6da
e92/element/0.17218413716182113-1/value
debug: Request received with params: {"id":"0.17218413716182113-1","value":["Che
ese!"]}
debug: Proxying command to 127.0.0.1:9515

info: Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/sessio
n/ebe57e3c76983d30a3ffc3c81a6dae92/element/0.17218413716182113-1/value","method"
:"POST","json":{"id":"0.17218413716182113-1","value":["Cheese!"]}}
info: Didn't get a new command in 60 secs, shutting down...
info: Shutting down appium session...
info: Killing chromedriver
info: Responding to client with error: {"status":13,"value":{"message":"An unkno
wn server-side error occurred while processing the command.","origValue":"Did no
t successfully proxy server command"},"sessionId":"ebe57e3c76983d30a3ffc3c81a6da
e92"}
POST /wd/hub/session/ebe57e3c76983d30a3ffc3c81a6dae92/element/0.1721841371618211
3-1/value 500 60016ms - 234b
info: Chromedriver exited with code null
info: (killed by signal SIGTERM)
info: [ADB] Getting connected devices...
debug: executing: adb devices
info: [ADB] 1 device(s) connected
debug: executing: adb shell "am force-stop com.android.chrome"



--
http://appium.io
---
You received this message because you are subscribed to a topic in the Google Groups "Appium-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/appium-discuss/XwpRvTigm00/unsubscribe.
To unsubscribe from this group and all its topics, send an email to appium-discus...@googlegroups.com.

Khushboo Kaur

unread,
Feb 13, 2014, 2:02:10 AM2/13/14
to appium-...@googlegroups.com, Khushboo Kaur
Yes thats the AVD issue. In the edit section of the ARM emulator, you need to select 'Use Host GPU'. By this, the UI of the chrome will be shown.

theghostwalker

unread,
Jun 30, 2014, 6:31:22 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.tibbr.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.?

Reply all
Reply to author
Forward
0 new messages