I'm trying to set up E2E testing on one of my windows asp.net (mvc->angular)projects. We use team city to do our builds so I want my configuration to work on my box and on the build box.
I'm stuck trying to set up the values in conf.js so that protractor will automatically start up and stop when protractor needs it...
I run it via a batch file like this:
call npm install -g
call C:\Users\brown.ericw\AppData\Roaming\npm\protractor conf.js
pause
Everything was working fine when I was running selenium manually.
But I just can't figure out the right conf.js to get selenium started and shut down automatically(Stopping it in the bat file was not always effective, despite several different approaches).
I've tried lots of different combos, but I'm stumped.
Here is the relevant portion of my conf.js:
exports.config = {
seleniumjar: '.\node_modules\protractor\selenium\selenium-server-standalone-2.45.0.jar',
//seleniumArgs: '-Dwebdriver.chrome.driver="\node_modules\protractor\selenium\chromedriver',
//chromeDriver: '.\node_modules\protractor\selenium\chromedriver',
//chromeDriver: '.\node_modules\protractor\bin\webdriver-manager',
chromeDriver: 'C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\protractor\selenium\chromedriver',
//seleniumAddress: 'http://localhost:4444/wd/hub',
specs: [
'e2eTests/*.js'
],
I have protractor installed under my project folder, so I run npm install, so I know it's all kosher at the beginning of the run on the build/test server.
Here is the error I'm getting.. Clearly I can't I figure out the setting to get get it pointing towards the chrome driver...
D:\TFS\TACAdmin3G_Test_E2E>call C:\Users\brown.ericw\AppData\Roaming\npm\protra ctor conf.js [launcher] Process exited with error code 1 C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\protractor\node_modules\q\ q.js:126 throw e; ^ Error: Could not find chromedriver at D:\TFS\TACAdmin3G\node_modules\protractor\ selenium\chromedriver at LocalDriverProvider.addDefaultBinaryLocs_ (C:\Users\Brown.ericw\AppData\R oaming\npm\node_modules\protractor\lib\driverProviders\local.js:54:15) at LocalDriverProvider.setupEnv (C:\Users\Brown.ericw\AppData\Roaming\npm\no de_modules\protractor\lib\driverProviders\local.js:71:8) at Runner.run (C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\protrac tor\lib\runner.js:265:31) at TaskRunner.run (C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\pro tractor\lib\taskRunner.js:123:19) at createNextTaskRunner (C:\Users\Brown.ericw\AppData\Roaming\npm\node_modul es\protractor\lib\launcher.js:220:20) at C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\protractor\lib\laun cher.js:243:7 at _fulfilled (C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\protrac tor\node_modules\q\q.js:797:54) at self.promiseDispatch.done (C:\Users\Brown.ericw\AppData\Roaming\npm\node_ modules\protractor\node_modules\q\q.js:826:30) at Promise.promise.promiseDispatch (C:\Users\Brown.ericw\AppData\Roaming\npm \node_modules\protractor\node_modules\q\q.js:759:13) at C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\protractor\node_mod ules\q\q.js:573:44
I tried changing the slashes because of the space in the path up there and it changed back to the normal path:
Error: Could not find chromedriver at D:\TFS\TACAdmin3G\_Test_E2E\..
which doesn't give me the whole path.
chromedriver.exe is in all the locations in the various commented version in the conf.js. but no joy truing each of them.
I need to use relative pathing because the root folder on my box is different than the one on the build server.
Any help is greatly appreciated.
Forgot to say I looked at this one:Protractor does not find chromedriver: The driver executable does not exist: and this one
how to close selenium webdriver at end of test?
and wasn't able to figure it out