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

4

8

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?

Lightning answered 8/5, 2014 at 16:4 Comment(1)
H
8

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.

Hube answered 8/5, 2014 at 17:29 Comment(2)
Same for me 2.10 did not work, 2.9 works perfectly. Thanks guys.Sitting
Putting "directConnect: true" inside protractor config solved issue to meAllan
P
0

Based on @Andrej Kaurin comment:

You can set directConnnect: true in your protractor configuration.

When this is set, protractor connects directly with browser driver and selenium is not needed.

More details: https://github.com/angular/protractor/blob/master/docs/server-setup.md#connecting-directly-to-browser-drivers

Polymyxin answered 12/8, 2016 at 6:47 Comment(0)
M
0

For me what worked was being on version 78.0.33904.70 of ChromeDriver and then version of Chrome Browser 78.0.3904.87

Here is the link to get Chrome Driver: http://chromedriver.storage.googleapis.com/index.html?path=78.0.3904.70/

How to check what version of chrome you have: https://support.chall.com/hc/en-us/articles/200336349-How-do-I-determine-what-version-of-Google-Chrome-I-m-using-

Medley answered 5/11, 2019 at 18:41 Comment(0)
C
0

I had this error when using new firefox.Service Builder('/path/to/geckodriver'), this error disappeared when I added the path to geckodriver to the variable $PATH.

Campney answered 13/2, 2022 at 9:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.