Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
530 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 Reply

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 ...
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...