playwright: Looks like Playwright was just installed or updated. ║ ║ Please run the following command to download new browsers:[BUG]

I am getting this error while running my first playwright test in Visual studio. Here is the full message in test detail summary:  Test1  Source: UnitTest1.cs line 13  Duration: 817 ms

Message:  Microsoft.Playwright.PlaywrightException : Executable doesn’t exist at C:\Users\Nizamani\AppData\Local\ms-playwright\chromium-1024\chrome-win\chrome.exe ╔════════════════════════════════════════════════════════════╗ ║ Looks like Playwright was just installed or updated. ║ ║ Please run the following command to download new browsers: ║ ║ ║ ║ pwsh bin/Debug/netX/playwright.ps1 install ║ ║ ║ ║ ❤️ Playwright Team ║ ╚════════════════════════════════════════════════════════════╝

Stack Trace:  Connection.InnerSendMessageToServerAsync[T](String guid, String method, Object args) line 163 Connection.WrapApiCallAsync[T](Func1 action, Boolean isInternal) BrowserType.LaunchAsync(BrowserTypeLaunchOptions options) line 61 Tests.Test1() line 18 GenericAdapter1.BlockUntilCompleted() NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter) AsyncToSyncAdapter.Await(Func`1 invoke) TestMethodCommand.RunTestMethod(TestExecutionContext context) TestMethodCommand.Execute(TestExecutionContext context) <>c__DisplayClass1_0.<Execute>b__0() DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)

Code Snippet public async Task Test1() { //initialize playwright using var playwright = await Playwright.CreateAsync(); //browser= await using var browser = await playwright.Chromium.LaunchAsync(); //page var page = await browser.NewPageAsync(); await page.GotoAsync(url:“www.google.com”); await page.ClickAsync(selector: “text=Google Search”);

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (2 by maintainers)

Most upvoted comments

FIrst use this to update powershell and fix issue:

  1. Go to project bin and then net6.0 or next folder and then press shift+mouse right click and then press open in powershell.
  2. Then run this dotnet tool install --global PowerShell This will update powershell.
  3. Then run this pwsh playwright.ps1 install to update playwright.

Hope this help : )

You need to open a Terminal, and then execute

pwsh bin/Debug/net6.0/playwright.ps1 install

inside you project’s directory.

Hello all, I fixed this by just running sudo playwright install ; for some reason it needed sudo privileges

Thank you so much! This one helped me on mac.

Hello all, I fixed this by just running sudo playwright install ; for some reason it needed sudo privileges

@EdwinArroyoM In your case the file playwright.ps1 is probably in another directory, you can search for it. You have to change “netX” to correct directory name. In my case the path was directoryWithCsprojFile\bin\Debug\net7.0\playwright.ps1.