browser-actions / setup-chrome

Set up your GitHub Actions workflow with a specific version of chromium
https://github.com/marketplace/actions/setup-chrome
MIT License
155 stars 63 forks source link

Upgrade chrome browser on windows self hosted machine #532

Closed ushankar5586 closed 5 months ago

ushankar5586 commented 6 months ago

Hello, I am using below steps in the yaml file

steps:
  - uses: browser-actions/setup-chrome@v1
  - run: chrome --version

I am getting this below error so can you please help on how to resolve it

Installing chromium...
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath 'C:\actions-runner\_work\_temp\443364dc-97fa-4064-81fa-e058cf6f5530' -DestinationPath 'C:\actions-runner\_work\_temp\fac04576-0e61-46ff-be44-c842022bb30d' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\actions-runner\_work\_temp\443364dc-97fa-4064-81fa-e058cf6f5530', 'C:\actions-runner\_work\_temp\fac04576-0e61-46ff-be44-c842022bb30d', $true) }"
Expand-Archive :  is not a supported archive file format. .zip is the only supported archive file format.
At line:1 char:210
+ ...  Ignore)) { Expand-Archive -LiteralPath 'C:\actions-runner\_work\_tem ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:String) [Expand-Archive], IOException
    + FullyQualifiedErrorId : NotSupportedArchiveFileExtension,Expand-Archive
ueokande commented 6 months ago

Thanks you for your report. I found similar issues

Could you try to update PowerShell on your self-hosted runner?

ushankar5586 commented 5 months ago

Thanks @ueokande Updating powershell resolve the above issue. So now after running this command - Run ``` browser-actions/setup-chrome@v1.6.0 with: chrome-version: latest


i am getting this message - Successfully setup chromium version 127.0.6495.0 
but when test is starting i am getting this message -  
Error Message:
   System.InvalidOperationException : session not created: This version of ChromeDriver only supports Chrome version 125
Current browser version is 124.0.6367.208 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
What could be the reason?
ueokande commented 5 months ago

The issue is caused by the incompatibility issue between Chrome and Chrome Driver. I think you install the latest Google Chrome by our action, but your test executes the pre-installed ChromeDriver in the GitHub Runner. You need to install a compatible version of ChromeDriver for Chrome 127.0.6495.0 before you run tests. Please refer to the ChromeDriver document to choose the correct version of ChromeDriver. We will track this issue in https://github.com/browser-actions/setup-chrome/issues/527

Thank you.