question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: I downloaded the microsoft playwright cli and it downloads the wrong versions of chrome

See original GitHub issue

Playwright version

1.12.0

Operating system

Windows

What browsers are you seeing the problem on?

Chromium

Other information

On windows 10

What happened? / Describe the bug

trying running playwright install but when I would run playwright it could never find Chrome. If I blew away my cached browsers it would download them but the wrong versions.

If I rename the version of the folder it works but if I ever reinstall browsers I have to go do it again.

Code snippet to reproduce your bug

using System;
using Microsoft.Playwright;
using System.Threading.Tasks;

namespace PlaywrightDemo
{
	class Program
	{
    public static async Task Main()
    {
        using var playwright = await Playwright.CreateAsync();
        await using var browser = await playwright.Chromium.LaunchAsync();
        var page = await browser.NewPageAsync();
        await page.GotoAsync("https://playwright.dev/dotnet");
        await page.ScreenshotAsync(new PageScreenshotOptions { Path = "screenshot.png" });
    }
	}
}

Relevant log output

D:\Source\playwright_sharp\PlaywrightTests> playwright install
Removing unused browser at C:\Users\user\AppData\Local\ms-playwright\chromium-907428
Downloading Playwright build of chromium v888113 - 97.7 Mb [================] 100% 0.0s
Playwright build of chromium v888113 downloaded to C:\Users\aleth\AppData\Local\ms-playwright\chromium-888113


Unhandled exception. Microsoft.Playwright.PlaywrightException: Executable doesn't exist at C:\Users\user\AppData\Local\ms-playwright\chromium-907428\chrome-win\chrome.exe
╔═════════════════════════════════════════════════════════════════════════╗
β•‘ Looks like Playwright Test or Playwright was just installed or updated. β•‘
β•‘ Please run the following command to download new browsers:              β•‘
β•‘                                                                         β•‘
β•‘     npx playwright install                                              β•‘
β•‘                                                                         β•‘
β•‘ <3 Playwright Team                                                      β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
   at Microsoft.Playwright.Transport.Connection.SendMessageToServerAsync[T](String guid, String method, Object args)
   at Microsoft.Playwright.Core.BrowserType.LaunchAsync(BrowserTypeLaunchOptions options)
   at PlaywrightDemo.Program.Main() in D:\Source\playwright_sharp\PlaywrightDemo\Program.cs:line 12
   at PlaywrightDemo.Program.<Main>()

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
alethcoecommented, Aug 18, 2021

Thank you for your help. Yes It was pointed at a previous python version of playwright.

I moved my environment variable up to put dotnet ahead of python and it works now. Closing as it was my error due to other language cli taking precedence.

0reactions
rsantosdevcommented, Nov 25, 2021

My apologies, after reading this again carefully I remembered that I was upgrading from .net 5 to .net 6 and I forgot to clear previous builds if anyone has the same issue, just run this command from the repo root folder to clear all bin and obj folders:

Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] `playwright install` installs incorrect browser versions.
Context: Playwright Version: 1.9.1 Operating System: Max OS Big Sur ... E β•‘ Please run the following command to download new browsers: β•‘...
Read more >
[BUG] Intermittent failures during Microsoft Edge and ...
For approximately 30-40% of the cases (After 300 runs), installation fails for either chrome or edge without any proper error. > install-browserΒ ...
Read more >
Browsers
Each version of Playwright needs specific versions of browser binaries to operate. You will need to use the Playwright CLI to install these...
Read more >
Browsers | Playwright Java
Each version of Playwright needs specific versions of browser binaries to operate. You will need to use the Playwright CLI to install these...
Read more >
Release notes
Chromium 116.0.5845.82; Mozilla Firefox 115.0; WebKit 17.0. This version was also tested against the following stable channels: Google Chrome 115; Microsoft ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found