Guarantee latest version of Chrome on Azure VM



  • We have automated tests run by an Azure pipeline on an Azure VM and would like to guarantee that the latest version of Chrome is installed before running the tests. Is there any way to do this?

    We use https://github.com/rosolko/WebDriverManager.Net to automate the Selenium WebDriver binaries management which means we always use the latest versions of those binaries, but that also means that whenever the version changes we get this error on the next test run:

    System.InvalidOperationException: session not created: This version of ChromeDriver only supports Chrome version 104. Current browser version is 103.0.5060.134 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe (SessionNotCreated).

    The "solution" we've been using is to remote into the VM, open Chrome, and update it. Sometimes a VM restart is necessary as well. While this works, it's quite cumbersome, and ideally it would happen automatically before each test run.

    Is there a better way to achieve this?



  • Create a PowerShell task in Azure DevOps and add this command to it

    "C:\Program Files (x86)\Google\Update\GoogleUpdate.exe" /c | cmd
    

    So we are running the google update exe in the command line which will update the google chrome before you run the other task. We are piping the command to cmd in PowerShell.




Suggested Topics

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