NullReferenceException in NewContextAsync
See original GitHub issueSystem.NullReferenceException : Object reference not set to an instance of an object.
at Microsoft.Playwright.Core.Browser.NewContextAsync(BrowserNewContextOptions options) in /_/src/Playwright/Core/Browser.cs:line 121
at Microsoft.Playwright.Core.Browser.NewPageAsync(BrowserNewPageOptions options) in /_/src/Playwright/Core/Browser.cs:line 164
- net6
<PackageReference Include="Microsoft.Playwright" Version="1.20.1" />
using System.Threading.Tasks;
using Microsoft.Playwright;
class Program
{
public static async Task Main()
{
using var playwright = await Playwright.CreateAsync();
await using var browser = await playwright.Chromium.LaunchAsync();
var page = await browser.NewPageAsync();
// ...
}
}
offending line
https://github.com/microsoft/playwright-dotnet/blob/main/src/Playwright/Core/Browser.cs#L121
((Tracing)context.Tracing).LocalUtils = LocalUtils;
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Use Microsoft.Playwright.Core.Browser.NewContextAsync ...
Use the NewContextAsync method in Microsoft.Playwright.Core package in your next Playwright-dotnet project with LambdaTest Automation Testing Advisor.
Read more >Use Microsoft.Playwright.MSTest.BrowserTest. ...
Use the NewContextAsync method in Microsoft.Playwright.MSTest package in your next Playwright-dotnet project with LambdaTest Automation Testing Advisor.
Read more >Browser | Playwright .NET
NewContextAsync . Added in: v1.8 browser.NewContextAsync. Creates a new browser context. It won't share cookies/cache with other browser ...
Read more >Execute Playwright not via test runner
raising a NullReferenceException for await browserTest.NewContext(); . I'm using: .NET 7; Chromium browser; OS: Linux (Docker).
Read more >How to maximize Chrome in Playwright using c# Nunit
To start the browser maximized, you need to pass null instead of width ... NewContextAsync(new BrowserNewContextOptions { ViewportSize = new ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Folding into https://github.com/microsoft/playwright-dotnet/issues/2069 Thank you folks for the input! We’ll fix it in the driver side and provide recent modification dates with the next release.
Done, #2175