0

In my Protractor project I get below error when execute npm test command

21:55:20] E/runner - Unable to start a WebDriver session.
[21:55:20] E/launcher - Error: SessionNotCreatedError: Unable to create new service: ChromeDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '00000FJ26VN2', ip: '172.30.161.17', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'
Driver info: driver.version: unknown

I tried below solution and didn't work for me.

Solution 1

This couldn't do due to my machine restriction

Other question I have is even after replacing the correct chromedriver in the below location when I start the server it still shows the wrong one. (i.e. chromedriver_75.0.3770.8.exe, But I replace that with chromedriver_74.0.3729.6.exe which is my current browser version.

File Location: protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium

logs when start the server

λ npm run webdriver-start

> protractor-typescript-cucumber@4.0.0 webdriver-start c:\Repository\GitExt\Protractor\protractor-cucumber-typescript
> webdriver-manager start

[22:08:04] I/start - java -Dwebdriver.chrome.driver=c:\Repository\GitExt\Protractor\protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_75.0.3770.8.exe -Dwebdriver.gecko.driver=c:\Repository\GitExt\Protractor\protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\geckodriver-v0.24.0.exe -jar c:\Repository\GitExt\Protractor\protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\selenium-server-standalone-3.141.59.jar -port 4444
[22:08:04] I/start - seleniumProcess.pid: 1380
22:08:04.708 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
22:08:04.825 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444
2019-06-13 22:08:04.883:INFO::main: Logging initialized @446ms to org.seleniumhq.jetty9.util.log.StdErrLog
22:08:05.145 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
22:08:08.881 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444

So as a resolution Can I pointing to the chromedriver specifically? What is the relationship between selenium-server-standalone-3.141.59.jar and the chromedriver? Is there a way to find the compatible chromedriver version for this jar

In my case I don't have access to update or downgrade my machine chrome browser version. So how it's possible to change the web driver version to align with chrome browser version.

Shabar
  • 2,617
  • 11
  • 57
  • 98
  • https://github.com/angular/protractor/blob/cc501f71bc1f995a83c1041e1aa489ea0f105679/lib/config.ts#L76 This is what you want. – tehbeardedone Jun 13 '19 at 15:27
  • @tehbeardedone In my case session doesn't even start. The question is even I replaced with different version of `chromedriver` why it is still looking for `c:\Repository\GitExt\Protractor\protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_75.0.3770.8.exe -Dwebdriver.gecko.driver=c:\Repository\GitExt\Protractor\protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\geckodriver-v0.24.0.exe`? – Shabar Jun 14 '19 at 06:34
  • Under the `webdriver-mamnger` folder in `config.json` I can see `"chromedriver": "2.27",` line under `webdriverVersions` list. Is that the reason I see the chrome version that mentioned in the above comment, each time when I start the server in spite of different `chromedriver.exe` placed in the folder. – Shabar Jun 15 '19 at 12:03
  • After deleting `chromedriver_75.0.3770.8.exe` from folder `c:\Repository\GitExt\Protractor\protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\` it worked. The question is because now no `chromedriver.exe` in the folder then where does the application picks up `chromedriver.exe`. Actually that's the initial question I had anyway. When I start the server it shows `[11:28:16] I/start - java -Dwebdriver.gecko.driver=c:\AGLRepository\GitExt\Protractor\protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\geckodriv` – Shabar Jun 16 '19 at 01:35

1 Answers1

0

I figured out the issue here and managed to have resolution.

Problem : Even though I placed the matching chromedriver.exe in path (c:\Repository\GitExt\Protractor\protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium) it's still looking for the original version which is coming fromwebdriver-update command.

So what I did was

  1. Removed chromedriver from the above path.
  2. Add the preferred one in some folder location and set that in env. variables. So if the driver is missing in the project folder it always goes to set path in the env. variables which the right one.

Despite of above solution I just wondering how I can change the driver version when run webdriver-update command?

Shabar
  • 2,617
  • 11
  • 57
  • 98
  • I found this command to set the required chrome browser version `node node_modules/protractor/bin/webdriver-manager update --versions.chrome 77.0.3865.75 ` – Shabar Nov 09 '19 at 11:21