user886596 user886596 - 3 months ago 36
Node.js Question

Node selenium-webdriver "Error: Timed out waiting for the WebDriver server at"

While following the instructions in the 'Getting Started' section of
the WebDriverJs documentation
and after running this snippet from their site:

var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();

driver.get('http://www.google.com');
driver.findElement(webdriver.By.name('q')).sendKeys('webdriver');
driver.findElement(webdriver.By.name('btnG')).click();
driver.wait(function() {
return driver.getTitle().then(function(title) {
return title === 'webdriver - Google Search';
});
}, 1000);

driver.quit();


I'm getting this error:

Error: Timed out waiting for the WebDriver server at http://XXX.XXX.X.XXX:60065/
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
==== async task ====
WebDriver.createSession()


I'm running OSX Mavericks using the mac32 version of ChromeDriver found here. The
chromedriver
executable is in my
/usr/local/bin
directory, and is accessible on my
path
.

One thing I notice is that when I run
chromedriver
from the command line, it runs on port
9515
, while the node code is looking for it on
60065
. However, there shouldn't be any extra configuration required for just running with the
chromedriver
.

Would anyone have any ideas on why I'm getting this error?

Answer

I was having this exact issue today and near as I can tell it's a bug with the current version of the selenium-webdriver package (2.41.0).

There is a bug filed with the Selenium project but I don't think the fix has made its way onto npm yet.

Downgrading to version 2.9.248307 of Chromedriver worked for me.