Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
524 views
in Technique[技术] by (71.8m points)

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Add the server to your config:

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

  capabilities ...
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...