0
votes

I'm running ng e2e --no-webdriver-update and getting this error:

C:\project\Angular>ng e2e --no-webdriver-update [12:13:05] I/direct - Using ChromeDriver directly... [12:13:05] E/direct - Error code: 135 [12:13:05] E/direct - Error message: Could not find chromedriver at null. Run 'webdriver-manager update' to download binaries. [12:13:05] E/direct - Error: Could not find chromedriver at null. Run 'webdriver-manager update' to download binaries. at Direct. (C:\project\Angular\node_modules\protractor\built\driverProviders\direct.js:74:31) at Generator.next () at C:\project\Angular\node_modules\protractor\built\driverProviders\direct.js:7:71 at new Promise () at __awaiter (C:\project\Angular\node_modules\protractor\built\driverProviders\direct.js:3:12) at Direct.getNewDriver (C:\project\Angular\node_modules\protractor\built\driverProviders\direct.js:57:16) at Runner. (C:\project\Angular\node_modules\protractor\built\runner.js:190:53) at Generator.next () at C:\project\Angular\node_modules\protractor\built\runner.js:7:71 at new Promise () [12:13:05] E/launcher - Process exited with error code 135 An unexpected error occurred: undefined

Running webdriver-manager updatedoesn't solve the issue.

This issue wasn't the same but gave some information.

EDIT: If I run ng e2e without --no-webdriver-update I get this error:

C:\project\Angular>ng e2e Cannot automatically find webdriver-manager to update. Update webdriver-manager manually and run 'ng e2e --no-webdriver-update' instead. Error: Cannot automatically find webdriver-manager to update. Update webdriver-manager manually and run 'ng e2e --no-webdriver-update' instead. at ProtractorBuilder._updateWebdriver (C:\project\Angular\node_modules@angular-devkit\build-angular\src\protractor\index.js:92:23) at MergeMapSubscriber.rxjs_1.of.pipe.operators_1.concatMap [as project] (C:\project\Angular\node_modules@angular-devkit\build-angular\src\protractor\index.js:32:200)

See here for more information.

1
You could be updating webdriver-manager and launching protractor in different scopes. Could you share both command you are using?DublinDev
I'm trying to run my e2e tests using: ng e2e --no-webdriver-updateHeinrich
Why are you setting --no-webdriver-update flag?DublinDev
see edit above, if I run without the flag, it gives an error which says to use the flagHeinrich

1 Answers

1
votes

I've seen a similar issue before and to troubleshoot it it's important to remember some things.

Node package like protractor can be installed at two scopes: globally on the machine and locally inside a Node project. The same goes for webdriver-manager. Whenever Protractor is installed a version of Webdriver-manager will be installed at the same time and at the same scope.

If you have webdriver-manager installed at two scopes then it is possible to update the files in one successfully but accidentally be launching protractor from the other.

When webdriver-manager update runs it download some files into the webdriver folder. This is an example of the folder structure to a local installation of webdriver-manager.

C:\ProtractorProjects\ddg\node_modules\protractor\node_modules\webdriver-manager

Here is a screenshot of that folder. The selenium file is essentially what gets created when webdriver-manager update runs. It contains the browser drivers required by your tests.

Screenshot of webdriver folder Screenshot of webdriver folder

Screenshot of selenium folder

Screenshot of selenium folder


Update webdriver locally using cmd: node_modules\.bin\webdriver-manager update

Update webdriver globally using cmd: webdriver-manager update


Can you check the relevant folder before and after a webdriver-manager update command and that may help you troubleshoot further