playwright-dotnet icon indicating copy to clipboard operation
playwright-dotnet copied to clipboard

[Bug]: Page.PageErrorsAsync() always seems to be empty

Open johncmJanes opened this issue 1 month ago • 2 comments

Version

1.56.0

Steps to reproduce

When I call Page.PageErrorsAsync() to get recent page errors it always seems to return nothing but Page.ConsoleMessagesAsync() does return the errors that I can see in the console.

Expected behavior

Page.PageErrorsAsync() should return the errors that I can see in Page.ConsoleMessagesAsync()

Actual behavior

Page.PageErrorsAsync() doesn't return any items

Additional context

No response

Environment

- Operating System: Windows 11
- CPU: Intel i7 x64
- Browser: Chromium
- .NET Version (TFM): net8.0

johncmJanes avatar Dec 01 '25 11:12 johncmJanes

Or have I misunderstood the purpose of this method?

If so, could the documentation be clarified please?

johncmJanes avatar Dec 01 '25 11:12 johncmJanes

Do you know how the errors are being logged that you want to see? It looks like Page.PageErrorsAsync() only lists uncaught exceptions.

https://playwright.dev/dotnet/docs/api/class-page#page-page-errors took me to https://playwright.dev/dotnet/docs/api/class-page#page-event-page-error which states (emphasis mine as it seems to be the important part here) "Emitted when an uncaught exception happens within the page."

PandaMagnus avatar Dec 11 '25 00:12 PandaMagnus