Closed Tony20221 closed 2 weeks ago
It looks like you are using .NET and npx (Node.js) in parallel. While this is supported we don't recommend it for your scenario - it would overcomplicate things. All npx playwright
commands work with the playwright.ps1
as well. Using npx
there adds another risk, because you'd have to keep the versions in sync (thats why it results in "browsers not found" errors for you).
Make sure to use have a recent PowerShell installed, otherwise it won't work: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.2 - this should fix it for you.
It works now. Thanks.
Version
1.47
Steps to reproduce
Example steps (replace with your own):
Expected behavior
Chrome to launch
Actual behavior
I have an NUnit project that's using Microsoft.Playwright.NUnit 1.47. The last time I ran npx playwright codegen https://.... It asked if I wanted to install 1.48 and entered Y. It installed the new browsers..
Now when I run the test in Visual Studio, I get the error below. My chrome for Playwright is in the chromium-1140 subfolder. Why is it looking in chromium-1134 folder? Where is it getting this path from? I am guessing there's a mismatch now between 1.47 in the app and 1.48 that got installed when it asked me. How do I fix this? I already ran
npx playwright install
. I tried runningpwsh playwright.ps1 install
in the folder where playwright.ps1 resides and got 'The argument 'playwright.ps1' is not recognized as the name of a script file.' error.Error: MyTest Failed: Microsoft.Playwright.PlaywrightException : Executable doesn't exist at C:\Users\Tony\AppData\Local\ms-playwright\chromium-1134\chrome-win\chrome.exe Microsoft.Playwright.PlaywrightException : Executable doesn't exist at C:\Users\Tony\AppData\Local\ms-playwright\chromium-1134\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 ║ ║ ║ ║ <3 Playwright Team ║ ╚════════════════════════════════════════════════════════════╝ at Microsoft.Playwright.Transport.Connection.InnerSendMessageToServerAsync[T](ChannelOwner object, String method, Dictionaryb_0>d.MoveNext() in //src/Playwright.NUnit/BrowserService.cs:line 44
--- End of stack trace from previous location ---
at Microsoft.Playwright.NUnit.WorkerAwareTest.RegisterService[T](String name, Func DisplayClass1_0.b__0()
at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
2 dictionary, Boolean keepNulls) in /_/src/Playwright/Transport/Connection.cs:line 206 at Microsoft.Playwright.Transport.Connection.WrapApiCallAsync[T](Func
1 action, Boolean isInternal) in //src/Playwright/Transport/Connection.cs:line 532 at Microsoft.Playwright.Core.BrowserType.LaunchAsync(BrowserTypeLaunchOptions options) in //src/Playwright/Core/BrowserType.cs:line 56 at Microsoft.Playwright.NUnit.BrowserService.CreateBrowser(IBrowserType browserType) in /_/src/Playwright.NUnit/BrowserService.cs:line 54 at Microsoft.Playwright.NUnit.BrowserService.<>cDisplayClass5_0.<1 factory) in /_/src/Playwright.NUnit/WorkerAwareTest.cs:line 55 at Microsoft.Playwright.NUnit.BrowserTest.BrowserSetup() in /_/src/Playwright.NUnit/BrowserTest.cs:line 46 at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter
1.BlockUntilCompleted() at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter) at NUnit.Framework.Internal.AsyncToSyncAdapter.Await[TResult](Func1 invoke) at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func
1 invoke) at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUpOrTearDownMethod(TestExecutionContext context, IMethodInfo method) at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUp(TestExecutionContext context) at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>cAdditional context
No response
Environment