Closed SmNizamani closed 2 years ago
You need to open a Terminal, and then execute
pwsh bin/Debug/net6.0/playwright.ps1 install
inside you project's directory.
You need to open a Terminal, and then execute
pwsh bin/Debug/net6.0/playwright.ps1 install
inside you project's directory.
I get this error message when I do:
PS C:\Users....\Desktop\Playwright\PlayWrightDemo> pwsh bin/Debug/net6.0/playwright.ps1 install pwsh : The term 'pwsh' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1
+ CategoryInfo : ObjectNotFound: (pwsh:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Using visual studio pro if that matters
You need to install PowerShell 7+, see here: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.2
You need to install PowerShell 7+, see here: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.2
Worked for me. Thank you
can you help me?
PS TestUserGit> pwsh bin/Debug/netX/playwright.ps1 install The argument 'bin/Debug/netX/playwright.ps1' is not recognized as the name of a script file. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Usage: pwsh[.exe] [-Login] [[-File]
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 ║ ║ ║ ║ <3 Playwright Team ║ ╚════════════════════════════════════════════════════════════╝
Stack Trace: Connection.InnerSendMessageToServerAsync[T](String guid, String method, Object args) line 163 Connection.WrapApiCallAsync[T](Funcb__0()
DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
1 action, Boolean isInternal) BrowserType.LaunchAsync(BrowserTypeLaunchOptions options) line 61 Tests.Test1() line 18 GenericAdapter
1.BlockUntilCompleted() NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter) AsyncToSyncAdapter.Await(Func`1 invoke) TestMethodCommand.RunTestMethod(TestExecutionContext context) TestMethodCommand.Execute(TestExecutionContext context) <>c__DisplayClass1_0.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");