{"id":6094,"date":"2014-04-13T02:17:56","date_gmt":"2014-04-13T02:17:56","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/13\/selenium-remotewebdriver-connection-to-selenium-standalone-server-fail-driver-version-unknown-collection-of-common-programming-errors\/"},"modified":"2014-04-13T02:17:56","modified_gmt":"2014-04-13T02:17:56","slug":"selenium-remotewebdriver-connection-to-selenium-standalone-server-fail-driver-version-unknown-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/13\/selenium-remotewebdriver-connection-to-selenium-standalone-server-fail-driver-version-unknown-collection-of-common-programming-errors\/","title":{"rendered":"Selenium remoteWebDriver : connection to selenium-standalone-server fail (driver version unknown)-Collection of common programming errors"},"content":{"rendered":"<p>I received an exception after trying to setup a connection to selenium-server-standalone by using remoteWebDriver in an application test written in Java.<\/p>\n<p>The issue is related the usage of remoteWebDriver starting selenium-server-standalone (with Xvfb) by using maven (because by running manually by a different session Xvfb and then selenium-server stand alone the application test is working). The environment is composed by RH Linux R4.1.x , Selenium 2.1, firefox 3.6. Both selenium-server-standalone and application test are executed on the same machine (Virtual Machine).<\/p>\n<p>As previously said, the application test run successfully connecting to the instance of selenium-server-standalone-2.21.0 if this instance is started by a separate PUTTY session (separate from the one used for starting the application test) with the following commands:<\/p>\n<pre><code>#Xvfb :20 &amp;\n#export DISPLAY=:20\n#Java -Dwebdriver.firefox.firefox=\"\/opt\/firefox\/firefox\"  -jar selenium-server-standalone-2-.21.0.jar  -port 4441.\n<\/code><\/pre>\n<p>The application test code for connecting to selenium-server-standalone is the following :<\/p>\n<pre><code>DesiredCapabilities capability = DesiredCapabilities.firefox();\ncapability.setPlatform(Platform.LINUX);\nWebDriver driver = new RemoteWebDriver (new URL(\"http:\/\/127.0.0.1:14444\/wd\/hub\"),capability);\ndriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n<\/code><\/pre>\n<p>Now trying to use maven for starting also xvfb and selenium-server-stand alone before starting the application test I get the following error (then within same putty session):<\/p>\n<pre><code>selenium server conenction string: http:\/\/127.0.0.1:14444\/wd\/hub\nbrand community file name orig :\/opt\/optism_svn\/trunk\/ITests\/Projects\/core\/bbCampaigns\/BrandCommunitiesWD\/src\/test\/resources\/Orig_BrandCommunity_Test6386.csv\nbefore connecting to web driver\n15:17:05.591 INFO - Executing: [new session: {platform=LINUX, browserName=firefox, version=}] at URL: \/session)\n15:17:05.651 WARN - Exception thrown\njava.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException\nBuild info: version: '2.2.1', revision: '16551', time: '2012-04-11 21:42:35'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.18-194.el5', java.version: '1.6.0_22'\nDriver info: driver.version: unknown\n        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)\n        at java.util.concurrent.FutureTask.get(FutureTask.java:83)\n        at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:158)\n        at org.openqa.selenium.remote.server.DefaultSession.(DefaultSession.java:112 )\n        at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:89)\n        at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:92)\n        at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:62)\n        at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:202)\n        at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:597)\n        at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:548)\n        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)\n        at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:520)\n        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)\n        at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)\n        at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:677)\n        at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)\n        at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530)\n        at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482)\n        at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909)\n        at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)\n        at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)\n        at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)\n        at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)\n        at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)\n        at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)\nCaused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException\nBuild info: version: '2.2.1', revision: '16551', time: '2012-04-11 21:42:35'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.18-194.el5', java.version: '1.6.0_22'\n**Driver info: driver.version: unknown**\n        at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:68)\n        at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:52)\n        at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:197)\n        at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:184)\n        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)\n        at java.util.concurrent.FutureTask.run(FutureTask.java:138)\n        at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:151)\n        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)\n        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)\n        at java.lang.Thread.run(Thread.java:662)\nCaused by: java.lang.reflect.InvocationTargetException\n        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)\n        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)\n        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)\n        at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:58)\n        ... 9 more\n**Caused by: java.lang.IllegalStateException: The path to the chromedriver executable must be set by the webdriver.chrome.driver system property**\n        at com.google.common.base.Preconditions.checkState(Preconditions.java:172)\n        at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:90)\n        at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:107)\n        ... 14 more\n**15:17:05.659 WARN - Exception: The path to the chromedriver executable must be set by the  webdriver.chrome.driver system property**\n<\/code><\/pre>\n<p>The pom.xml used for starting xvfb and selenium server is the following one (extract of part related xvfb and selenium) :<\/p>\n<pre><code>\n    \n    2.21.0\n2.3\n\n\norg.seleniumhq.selenium\nselenium-java\n${selenium-version}\n\n<\/code><\/pre>\n<p>&#8230;..<\/p>\n<pre><code>\norg.codehaus.mojo\nselenium-maven-plugin\n${selenium-plugin-version}\n\ntrue\n14444\n\n\n\n\nxvfb\npre-integration-test\n\nxvfb\n\n..                      \n\nstart-selenium-server\npre-integration-test\n\nstart-server\n\n\n<\/code><\/pre>\n<p>Any idea for solving the issue? Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I received an exception after trying to setup a connection to selenium-server-standalone by using remoteWebDriver in an application test written in Java. The issue is related the usage of remoteWebDriver starting selenium-server-standalone (with Xvfb) by using maven (because by running manually by a different session Xvfb and then selenium-server stand alone the application test is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6094","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6094","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6094"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6094\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}