SeleniumEnv icon indicating copy to clipboard operation
SeleniumEnv copied to clipboard

Chromedriver can't be found

Open tcql opened this issue 10 years ago • 5 comments

When I try running tests targeting the chrome browser with Selenium-Env, the webdriver fails saying that the chromedriver path must be set:

15:47:51.215 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37'
System info: host: '20ed70700620', ip: '172.17.0.6', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.3-1-ARCH', java.version: '1.7.0_60'
Driver info: driver.version: unknown
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:175)
    at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:111)
    at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:88)
    at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:108)
    at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:57)
    at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:1)
    at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:112)
    at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:172)
    at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:201)
    at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:163)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:129)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
    at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
    at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
    at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
    at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
    at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
    at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
    at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
    at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
    at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
    at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
    at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37'
System info: host: '20ed70700620', ip: '172.17.0.6', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.3-1-ARCH', java.version: '1.7.0_60'
Driver info: driver.version: unknown
    at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:69)
    at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance(DefaultDriverProvider.java:53)
    at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:54)
    at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:214)
    at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:168)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:59)
    ... 9 more
Caused by: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
    at com.google.common.base.Preconditions.checkState(Preconditions.java:197)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:105)
    at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:89)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:139)
    ... 14 more
15:47:51.221 WARN - Exception: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html

tcql avatar Nov 14 '14 15:11 tcql

Looks like selenium requires the argument -Dwebdriver.chrome.driver=path/to/chromedriver, when supporting chrome connections. Also the version of chromium installed in the box doesn't include chromedriver. Poking on ubuntu's package database, I found that trusty has chromium-chromedriver as a package but nothing for precise.

tcql avatar Nov 14 '14 19:11 tcql

Yeah, I didnt have a chance to test chromium by myself. Sorry :( I just installed it from cookbooks. Looks like I need to dig deeper to find what chromium needs to start

DavertMik avatar Nov 14 '14 22:11 DavertMik

I think you'll just need to manually download the chromedriver package and install it and then supply selenium with the webdriver.chrome.driver flag when starting it

tcql avatar Nov 17 '14 15:11 tcql

I've been looking at this today, and seems like there's some issue (that I can't nail down yet) with chromedriver running correctly inside the image. I've got it downloaded, got selenium-server starting it up, but when my test suite makes a connection, it dies with some rather cryptic java errors... so either selenium is doing something odd, or chromedriver is. I'll keep looking and let you know what I come up with.

tcql avatar Nov 17 '14 21:11 tcql

Thanks for looking into this. Maybe it really needs more Java packages, or it stuks into some Docker limitation. Interesting question.

2014-11-17 23:17 GMT+02:00 tchannel [email protected]:

I've been looking at this today, and seems like there's some issue (that I can't nail down yet) with chromedriver running correctly inside the image. I've got it downloaded, got selenium-server starting it up, but when my test suite makes a connection, it dies with some rather cryptic java errors... so either selenium is doing something odd, or chromedriver is. I'll keep looking and let you know what I come up with.

— Reply to this email directly or view it on GitHub https://github.com/Codeception/SeleniumEnv/issues/1#issuecomment-63377368 .

DavertMik avatar Nov 17 '14 21:11 DavertMik