-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed as not planned
Description
Version
1.50.0 (Playwright for .NET)
Steps to reproduce
static async Task Main(string[] args)
{
var contextOptions = new BrowserTypeLaunchPersistentContextOptions { Headless = true };
var playwright = await Playwright.CreateAsync();
var content1 = await playwright.Firefox.LaunchPersistentContextAsync(@"C:\Users\xx\Desktop\test\ff", contextOptions);
var content2 = await playwright.Firefox.LaunchPersistentContextAsync(@"C:\Users\xx\Desktop\test\ff", contextOptions);
var page1 = await content1.NewPageAsync();
var page2 = await content2.NewPageAsync();
await page1.CloseAsync();
await page2.CloseAsync();
await content1.CloseAsync();
await content2.CloseAsync();
playwright.Dispose();
}Expected behavior
There are no errors after the execution is completed
Actual behavior
When executing on second playwright.Firefox.LaunchPersistentContextAsync,
- First, Firefox pops up the error window:
Firefox is already running, but is not responding. The old Firefox process must be closed to open a new window.
- Then, playwright throw the exception:
TargetClosedException. details:
Microsoft.Playwright.TargetClosedException
HResult=0x80131500
Message=Target page, context or browser has been closed
Browser logs:
<launching> C:\Users\xx\AppData\Local\ms-playwright\firefox-1471\firefox\firefox.exe -no-remote -headless -profile C:\Users\xx\Desktop\test\ff -juggler-pipe about:blank
<launched> pid=22724
[pid=22724][err] *** You are running in headless mode.
[pid=22724] <process did exit: exitCode=0, signal=null>
[pid=22724] starting temporary directories cleanup
Call log:
- - <launching> C:\Users\xx\AppData\Local\ms-playwright\firefox-1471\firefox\firefox.exe -no-remote -headless -profile C:\Users\xx\Desktop\test\ff -juggler-pipe about:blank
- - <launched> pid=22724
- - [pid=22724][err] *** You are running in headless mode.
- - [pid=22724] <process did exit: exitCode=0, signal=null>
- - [pid=22724] starting temporary directories cleanup
Source=Microsoft.Playwright
StackTrace:
at Microsoft.Playwright.Transport.Connection.<InnerSendMessageToServerAsync>d__40`1.MoveNext()
at Microsoft.Playwright.Transport.Connection.<WrapApiCallAsync>d__52`1.MoveNext()
at Microsoft.Playwright.Core.BrowserType.<LaunchPersistentContextAsync>d__11.MoveNext()
at TestPwTwoContent.Program.<Main>d__0.MoveNext() in C:\Users\xx\source\repos\TestPwTwoContent\TestPwTwoContent\Program.cs:line 12
- But, if change to chrome, everything is OK.
var content1 = await playwright.Chromium.LaunchPersistentContextAsync(@"C:\Users\xx\Desktop\test\chrome", contextOptions);
var content2 = await playwright.Chromium.LaunchPersistentContextAsync(@"C:\Users\xx\Desktop\test\chrome", contextOptions);Additional context
No response
Environment
Microsoft Windows [版本 10.0.19045.5608]
net9.0
Playwright for .NET 1.50.0
firefox-1471
chromium-1155Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
