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

前端 未结 14 1815
感动是毒
感动是毒 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

    On mac osx, change the version in package.json for protractor to "*", remove node_modules, and install again.

    0 讨论(0)
  • 2021-01-30 13:34

    The standalone selenium file was corrupt so i had to overwrite it, copying it into the folder directly.

    C:/Users/****/AppData/Roaming/npm/node_modules/protractor/selenium/
    

    Also i had to rename the chromedriver so it is actually called "chromedriver" and not "chromedriver.exe".

    C:/Users/****/AppData/Roaming/npm/node_modules/protractor/selenium/chromedriver
    

    This partially happened because i did not set the proxy in webdriver. You can see the Solution for this in the accepted answer.

    0 讨论(0)
  • 2021-01-30 13:43

    If you are behind a proxy then try setting proxy first and then run webdriver update:

    npm config set proxy http://<proxy.com>:port
    
    webdriver-manager update
    
    0 讨论(0)
  • 2021-01-30 13:45

    In my case it was the due to damaged chromedriver zip file.

    I have done following things to resolve this problem.

    1. Downloaded chromedriver zip from ChromeDriver Download Page

    2. Extracted that zip file at "node_modules\protractor\selenium\" (i.e. Copied "chromedriver.exe" to this location)

    Then it started working as expected. Hope this will help you.

    0 讨论(0)
  • 2021-01-30 13:46

    The Chrome driver can exist in any location, but the protractor runner seems to expect it to be in the location where it would exist if you installed it through "webdriver-manager". Thus, it can be installed with "npm install chromedriver", which will place it in a different location, such as: /usr/local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver

    In this case, the config file will need to be set to look in this location, but there is likelt a simpler solution...

    If webdriver-manager fails to download either the chromedriver or selenium-standalone, there will be 0-byte files in the default location, which will cause this error. Unfortunately, this can happen with proxy related issues. Once the corrupt files are there, the update check process thinks everything is up-to-date, but it's not.

    Also, the proxy configuration for webdriver-manager is different than npm. For webdriver-manager, the syntax to do an update would be:

    sudo webdriver-manager update --proxy=http://<your proxy server>/
    

    Clearing out the 0-byte files and re-running this update command should replace the files with their correct data. The location on my machine for these files is:

    /usr/local/lib/node_modules/protractor/selenium
    
    0 讨论(0)
  • 2021-01-30 13:47

    Jeez, so many answers...

    On the Mac, this worked for me:

    $ npm install chromedriver
    $ ln -sf ~/angular-phonecat/node_modules/chromedriver/bin/chromedriver node_modules/protractor/selenium/chromedriver.exe
    

    There's GOT to be a better way of fixing it but at least this let me move on.

    0 讨论(0)
提交回复
热议问题