microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.4k stars 3.63k forks source link

[BUG] #26339

Closed starlordgit007 closed 1 year ago

starlordgit007 commented 1 year ago

System info

Source code

    BrowserTypeLaunchOptions lobjBrowserLaunchOptions = new BrowserTypeLaunchOptions()
    {
        Channel = "chromium",
        Headless = true,
    };
    using var playwright = await Playwright.CreateAsync();
    await using var browser = await playwright.Chromium.LaunchAsync(lobjBrowserLaunchOptions);
    await using var context = await browser.NewContextAsync();

    var page = await context.NewPageAsync();
    await page.GotoAsync("https://playwright.dev/dotnet");
    await page.ScreenshotAsync(new() { Path = "screenshotsdfsafsdfssfd1.png" });

After launching project using WSL I am getting below error : Microsoft.Playwright.PlaywrightException: 'Navigation failed because page crashed!

dgozman commented 1 year ago

@starlordgit007 The page is crashing. Try running with DEBUG=pw:browser environment variable - perhaps we'll see some crash logs?

starlordgit007 commented 1 year ago

Thanks for quick response.

I was able to solve the issue by upgrading to WSL2 version. wsl --set-version Ubuntu-22.04 2

Thank You!

seemab-yamin commented 3 months ago

Thanks, starlordgit007. It helped 💯