Search code examples
angulargoogle-chromeprotractorangular-e2e

Protractor: "session not created: Chrome version must be between 71 and 75"


I'm trying to run Angular Protractor e2e tests and getting this error:

session not created: Chrome version must be between 71 and 75

Solution

  • One way to solve this problem is to upgrade the Chrome version to the latest and webdriver-manager to the latest.

    • Upgrade Chrome version to latest:

    Go to Chrome --> Help --> About Google Chrome and update to the latest version

    Method 1: Upgrade Webdriver Manager

    • Upgrade webdriver-manager to latest:

    Go to your project and upgrade webdriver-manager to the latest with the below command:

    npm update protractor -g
    node ./node_modules/protractor/bin/webdriver-manager update --gecko=false --versions.chrome <version_number>
    

    Method 2: Uninstall Node, Protractor, and install again and upgrade Webdriver-manager If webdriver-manager is not upgraded to latest then uninstall the node, protractor and then install by following the below steps

    • Uninstall Node, npm, protractor

    Go to the terminal and run the following commands:

    sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} 
    

    To completely uninstall node + npm, do the following:

    1. go to /usr/local/lib and delete any node and node_modules
    2. go to /usr/local/include and delete any node and node_modules directory
    3. If you installed with brew install node, then run brew uninstall node in your terminal.
    4. Check your Home directory for any local or lib or include folders, and delete any node or node_modules from there
    5. Go to /usr/local/bin and delete any node executable

    You may also need to do:

    sudo rm -rf /opt/local/bin/node /opt/local/include/node /opt/local/lib/node_modules
    sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node.1 /usr/local/lib/dtrace/node.d
    
    rm -rf /Users/[homedir]/.npm  (eg:- rm -rf /Users/Sarada/.npm)
    rm -rf /Users/[homedir]/.nvm
    

    You can verify whether it uninstalled or not by running the following commands (you will get the response as *blank)

    which node
    which npm
    which protractor
    
    • Install Node & npm

    Download the latest node.js from https://nodejs.org/en/download/ website and unzip and install.

    goto terminal and check the node and npm version installed

    node --version
    npm -v
    
    • Install protractor

    run the following command in terminal to install protractor

    sudo npm install -g protractor
    
    sudo webdriver-manager update
    
    • Upgrade the chromedriver version in the project

    Go to the project and remove the 'node_modules' folder and run the following commands to install the latest version of the chrome driver.

    npm install
    
    webdriver-manager update