1

How can I use command prompt to get the Chrome version on the vmImage on Azure DevOps pipeline?

Alan Díaz
  • 43
  • 1
  • 8
  • How is this related to Selenium? Searching your question on google yields a few helpful results: https://stackoverflow.com/questions/50880917/how-to-get-chrome-version-using-command-prompt-in-windows – CEH Jan 14 '20 at 21:48
  • but I'm trying to know it from inside the pipeline on the virtual machine, not on my local machine – Alan Díaz Jan 15 '20 at 00:36

2 Answers2

2

Try below script in Command line task:

wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value

Then choose corresponding vmimage you want to run.

enter image description here

Mengdi Liang
  • 17,577
  • 2
  • 28
  • 35
  • Thank you, now my question is...this is the version installed in the vm right? because on the documentation it says that if im using vmImage: 'windows-2019' it contains this https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md which is Google Chrome version: 77.0.3865.90 – Alan Díaz Jan 15 '20 at 05:27
  • @AlanDíaz, Yeah, it is the latest version in real time while you use this script with hosted agent. For doc or the readme in github, I am letting the team which own the agent source code and document know this, and update it. You are not the first one who found the doc is too old. – Mengdi Liang Jan 15 '20 at 05:34
1

You can get the Chrome version in Azure Devops with a Powershell task containing this code:

$chromeVersion = ((Get-Item "C:\Program Files\Google\Chrome\Application\chrome.exe").VersionInfo).ProductVersion