protractor stand alone selenium fails: Error: Timed out waiting for the WebDriver server at
Asked Answered
I

2

7

I have installed protractor with the stand alone selenium server:

webdriver-manager update

If I run protractor with the stand alone server already running and the config pointed at that selenium instance it works fine.

I want to have protractor start the server and then run the tests. By default protractor finds chrome driver and the selenium server jar so I am using a minimal config:

exports.config = {
    capabilities: {
        'browserName': 'chrome'
    },
    specs: ['test/e2e/*.js']
};

But when it launches it can't connect to the server.

Error: Timed out waiting for the WebDriver server at http://192.168.1.146:56159/
wd/hub

I have noticed that when starting seleniumn with webdriver-manager start that the server starts up on localhost. I can't seem to get protractor to do the same.

My guess is that the firewall is preventing the connection.

Environment Version info: - grunt v0.4.1
- node 0.10.18 - selenium-server-standalone-2.37.0.jar - selenium-server-standalone-2.38.0.jar - protractor 0.14.0 - windows 7 Pro

Interrelate answered 12/12, 2013 at 22:54 Comment(1)
E
3

Add the server to your config:

exports.config = {
  // The address of a running selenium server.
  seleniumAddress: 'http://localhost:4444/wd/hub',

  capabilities ...
}
Esposito answered 14/12, 2013 at 4:1 Comment(1)
Thanks. Adding the server to the config means that you are running a stand alone selenium server. Which is what I ended up doing. I had to launch a separate task for that and wait for it to initialize the server before starting selenium. It's a pain. There is a more deterministic path, but it only seemed to work when I wasn't on the company vpn.Interrelate
P
1

If you need a stand alone server for Chrome only, you may use the Selenium ChromeDriver executable. webdriver-manager update --chrome should do that for you, or if you're behind the company VPN or proxy, you may download it manually from http://chromedriver.storage.googleapis.com/2.9/chromedriver_win32.zip to C:\Users\*your-user-name*\AppData\Roaming\npm\node_modules\protractor\selenium (protractor 0.22.0 matches chromedriver 2.9). Incorrect version of ChromeDriver, e.g. 2.10, can indeed cause the Error: Timed out waiting for the WebDriver server at ....

Your configuration file should look like the following:

exports.config = {
  chromeOnly: true,
  chromeDriver: '../selenium/chromedriver',
  capabilities: {
    'browserName': 'chrome'
  },
  specs: ['test/e2e/*.js'],
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000
  }
};
Pyrethrum answered 8/5, 2014 at 14:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.