Warn user for conflicting selenium arguments in the config file
I am new to the protractor. I do not wan to launch webdriver-manager from the command line before running my tests. I want my script to launch the webdriver-manager. I tried setting the '.jar' path inside my config file. But it does not help. Here is my config file-
exports.config = {
seleniumServerJar: '/usr/local/lib/node_modules/protractor/selenium/selenium-server-standalone-2.44.0.jar',
seleniumPort: '4445',
seleniumArgs: '-help',
seleniumAddress: 'http://localhost:4445/wd/hub',
specs: ['spec.js'],
capabilities: {
'browserName': 'chrome'
}
}
Here is the error I am getting when I am trying to run-
Using the selenium server at http://localhost:4445/wd/hub
[launcher] Running 1 instances of WebDriver
ERROR - Unable to start a WebDriver session.
/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:145
callback(new Error(message));
^
Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:145:16)
at ClientRequest.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1552:9)
at Socket.emit (events.js:95:17)
at net.js:441:14
at process._tickCallback (node.js:442:13)
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:149:22)
at Function.webdriver.WebDriver.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:123:30)
at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:294:22)
at DriverProvider.getNewDriver (/usr/local/lib/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7)
at Runner.createBrowser (/usr/local/lib/node_modules/protractor/lib/runner.js:180:37)
at /usr/local/lib/node_modules/protractor/lib/runner.js:246:21
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:759:13)
[launcher] Process exited with error code 1
How can I launch webdriver-manager from my script or config file.
You should not specify both seleniumServerJar and seleniumAddress. Remove the seleniumAddress specification. Please see https://github.com/angular/protractor/blob/master/docs/referenceConf.js for more details.
Closing as this is a question.
I appreciate your response. It worked fine after removing that line.
@juliemr I just ran into this as well. Would it be possible to log a warning to the console if you detect both properties are being used in the config?