How to autoupdate Chrome-driver in Selenium?



  • Every now and then when the Chrome is updated, the existing chrome driver used in the script becomes invalid and the below error message is displayed:

    selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 77
    

    I have to manually update the chrome-driver in the written script. Is there any way to update it automatically with the updated chrome version?



  • Try using webdriver-manager from npm:

    https://www.npmjs.com/package/webdriver-manager

    And call webdriver-manager update using batch file from your java, python or what ever tool .

    To create batch file , open a text file and add webdriver-manager update as the content and now save it as file.bat



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2