<p>Create a PowerShell task in Azure DevOps and add this command to it</p>
<pre><code>&quot;C:\Program Files (x86)\Google\Update\GoogleUpdate.exe&quot; /c | cmd
</code></pre>
<p>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.</p>

CC BY-SA 4.0
2022-08-09T15:28:10.790Z
I don't think this will achieve what I need. There is already a scheduled task that runs exactly this command (it gets created when Chrome is installed) and the problem still occurs. Running it explicitly again shouldn't make a difference.
Farinha
CC BY-SA 4.0
2022-08-09T15:58:56.507Z
But this does checks and runs an update if there is any, it should make a difference. are you sure about this if you run this manually can u check if the result is achieved?
SandeshR
CC BY-SA 4.0
2022-08-05T13:52:44.797Z
2022-08-05T13:52:44.797Z
SandeshR
<p>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?</p>
<p>We use <a href="https://github.com/rosolko/WebDriverManager.Net" rel="nofollow noreferrer">WebDriverManager.Net</a> 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:</p>
<blockquote>
<p>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).</p>
</blockquote>
<p>The &quot;solution&quot; 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.</p>
<p>Is there a better way to achieve this?</p>

<azure-devops><azure><azure-pipelines><vm><selenium>
Guarantee latest version of Chrome on Azure VM
Farinha
# Guarantee latest version of Chrome on Azure VM

(Asked by: username_0 on 2022-08-04)

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 [WebDriverManager.Net](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?

**Tags:** azure-devops, azure, azure-pipelines, vm, selenium


---

## 1 answers

### Answer by username_1 on 2022-08-05. Score: 1

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.

> **Comments:**
> **username_0**: I don't think this will achieve what I need. There is already a scheduled task that runs exactly this command (it gets created when Chrome is installed) and the problem still occurs. Running it explicitly again shouldn't make a difference.  
> **username_1**: But this does checks and runs an update if there is any, it should make a difference. are you sure about this if you run this manually can u check if the result is achieved?  

---

