{"action":"created","issue":{"url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1403","labels_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1403/labels{/name}","comments_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1403/comments","events_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1403/events","html_url":"https://github.com/SeleniumHQ/selenium/issues/1403","id":123435578,"number":1403,"title":"Out-of-the-box Selenium webdriver for FF does not work on Linux","user":{"login":"debbiesrain","id":16397509,"avatar_url":"https://avatars.githubusercontent.com/u/16397509?v=3","gravatar_id":"","url":"https://api.github.com/users/debbiesrain","html_url":"https://github.com/debbiesrain","followers_url":"https://api.github.com/users/debbiesrain/followers","following_url":"https://api.github.com/users/debbiesrain/following{/other_user}","gists_url":"https://api.github.com/users/debbiesrain/gists{/gist_id}","starred_url":"https://api.github.com/users/debbiesrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debbiesrain/subscriptions","organizations_url":"https://api.github.com/users/debbiesrain/orgs","repos_url":"https://api.github.com/users/debbiesrain/repos","events_url":"https://api.github.com/users/debbiesrain/events{/privacy}","received_events_url":"https://api.github.com/users/debbiesrain/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SeleniumHQ/selenium/labels/D-firefox","name":"D-firefox","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-12-22T08:05:35Z","updated_at":"2016-01-21T15:56:37Z","closed_at":null,"body":"Setup: Selenium Webdriver 2.48.2, FFv42, Xvfb (installed and running), mocha-v2.3.4, node-v4.2.2, Linux machine (Red Hat 7)\r\n\r\nThis setup worked perfectly fine in my windows local machine. But when I set this up in Linux and run my nodejs/mocha tests, I get this error:\r\n\r\nError: Timed out waiting for the WebDriver server at http://127.0.0.1:56318/hub\r\n[11:51:10][npm test]       at Error (native)\r\n[11:51:10][npm test]       at onResponse (/home/teamcity/buildagent2/node_modules/selenium-webdriver/http/util.js:89:11)\r\n[11:51:10][npm test]       at /home/teamcity/buildagent2/node_modules/selenium-webdriver/http/util.js:44:21\r\n[11:51:10][npm test]       at /home/teamcity/buildagent2/node_modules/selenium-webdriver/lib/webdriver/http/http.js:140:5\r\n[11:51:10][npm test]       at ClientRequest.<anonymous> (/home/teamcity/buildagent2/shimano_b2b-test/node_modules/selenium-webdriver/http/index.js:174:7)\r\n[11:51:10][npm test]       at Socket.socketErrorListener (_http_client.js:259:9)\r\n[11:51:10][npm test]       at emitErrorNT (net.js:1253:8)\r\n[11:51:10][npm test]   From: Task: WebDriver.createSession()\r\n\r\nI just used the out-of-the-box selenium webdriver for Firefox. And like I said, it works fine in my windows local machine, because it can fire up a native server inside it and listen to the localhost's ip address for browser requests.\r\n\r\nAfter so many hours spent in investigation and analysis, here's the code written by the selenium guys behind the scenes rendering this:\r\n\r\nFile path & name: /node_modules/selenium-webdriver/firefox/index.js\r\n  \r\nvar serverUrl = this.command_\r\n      .then(function() { return freePort; })\r\n      .then(function(port) {\r\n        var serverUrl = url.format({\r\n          protocol: 'http',\r\n          hostname: net.getLoopbackAddress(), <------------------------------ renders 127.0.0.1\r\n          port: port,\r\n          pathname: '/hub'\r\n        });\r\n        return httpUtil.waitForServer(serverUrl, 45 * 1000).then(function() {\r\n          return serverUrl;                                   <---------------------------waitForServer() throws the error\r\n        });\r\n      });\r\n\r\nQUESTIONS: \r\n1.) In a Linux machine, is this also returning this loopbackaddress as 127.0.0.1?\r\n2.) Do I need a Selenium standalone server to run to serve http client requests? \r\n3.) Did I miss a step in configuring my set-up and tests?\r\n\r\nI would appreciate any help from anybody. Thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/comments/173615595","html_url":"https://github.com/SeleniumHQ/selenium/issues/1403#issuecomment-173615595","issue_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1403","id":173615595,"user":{"login":"cgoldberg","id":1113081,"avatar_url":"https://avatars.githubusercontent.com/u/1113081?v=3","gravatar_id":"","url":"https://api.github.com/users/cgoldberg","html_url":"https://github.com/cgoldberg","followers_url":"https://api.github.com/users/cgoldberg/followers","following_url":"https://api.github.com/users/cgoldberg/following{/other_user}","gists_url":"https://api.github.com/users/cgoldberg/gists{/gist_id}","starred_url":"https://api.github.com/users/cgoldberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgoldberg/subscriptions","organizations_url":"https://api.github.com/users/cgoldberg/orgs","repos_url":"https://api.github.com/users/cgoldberg/repos","events_url":"https://api.github.com/users/cgoldberg/events{/privacy}","received_events_url":"https://api.github.com/users/cgoldberg/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T15:56:37Z","updated_at":"2016-01-21T15:56:37Z","body":"> xvfb-run --server-num=11 node\r\n> xvfb-run firefox &\r\n> xvfb-run java -jar selenium-server-standalone-2.48.2.jar &\r\n\r\n2 observations:\r\n\r\n1) don't start firefox manually like in the lines above.  You want selenium to start firefox for you as part of a test case.\r\n\r\n2) if you don't stop Xvfb,  running tests again (using the commands above) will try to reuse the same display number that Xvfb is already attached to... and it will fail.\r\n\r\n"}}