Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 713
user886596 Avatar asked May 08 '14 16:05

user886596


1 Answers

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.

like image 106
mbcrute Avatar answered Sep 21 '22 13:09

mbcrute