protractor/selenium “could not find chromedriver at” (on Windows)

前端 未结 14 1957
感动是毒
感动是毒 2021-01-30 12:45

I installed protractor following this tutorial and when i use webdriver-manager update it says:

selenium standalone is up to date.
chromedriver is up to date.
         


        
14条回答
  •  轮回少年
    2021-01-30 13:33

    I was facing this error too and by the time I read the tutorial, it did not cover how to install protractor and the webdriver as local dependencies to your project (which are located in ./node_modules).

    If this is what you prefer (probably because you might want to use grunt-protractor-runner and run your test later in a continuous build manner as I neede) instead of installing it globally, this solution worked for me:

    1. Install protractor:

    npm install protractor --save-dev

    1. Install selenium and the webdrivers with the webdriver-manager by running:

    ./node_modules/protractor/bin/webdriver-manager update

    After calling this command have a look at ./node_modules/protractor and it subfolders to verify it. A folder called selenium with the chromedriver in should be available in it.

    Note that as protractor was not installed as "global", calling it from the command line will result in a "commnad not found" error. You can run it instead with this command: ./node_modules/protractor/bin/protractor

    Additionaly, it might be a good idea to add a script definition to your package.json, so that next time you install all your dependencies from zero, npm setup the webdrivers automaticaly. For that add this to your package.json file: "scripts": { "postinstall": "./node_modules/protractor/bin/webdriver-manager update" }

    Hope this helps you further...

提交回复
热议问题