-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: playwright breaks to set content and load chromium with C# code #3061
Comments
the script doesn't compile for me - do you mind sharing a minimal csharp project which surfaces this issue? Ideally a small git repository. |
here is a sample csharp project. |
as mentioned, this issue doesnot occur always but once in 20+ trials only. there seems to be problem at playwright transport layer according to me as mentioned in log files: at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) |
I see |
When is newer version v1.49.0 of Playwright going to launch, so we can start using from that? |
~ 1 week - I recommend 1.48 so far. |
Version
1.40.0
Steps to reproduce
This is the code written in C#
using var playwright = await Playwright.CreateAsync().ConfigureAwait(false);
_logger.Information("Playwright starting to launch chromium");
// Open a new instance of the Google Chrome browser in headless mode
await using var browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions { Headless = true }).ConfigureAwait(false);
_logger.Information("Playwright launched chromium");
const int SM_CXSCREEN = 0;
const int SM_CYSCREEN = 1;
// Get the screen resolution
int screenWidth = GetSystemMetrics(SM_CXSCREEN);
int screenHeight = GetSystemMetrics(SM_CYSCREEN);
// Create a new page in the browser
var page = await browser.NewPageAsync(new BrowserNewPageOptions
{
ViewportSize = new ViewportSize { Width = screenWidth, Height = screenHeight },
}).ConfigureAwait(false);
await page.SetContentAsync(result).ConfigureAwait(false);
Expected behavior
It should run without errors and load the html content
Actual behavior
while running this code, it throws this error sometimes and it happens once in 20 runs:
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: