Context:
- Playwright Version: 1.13.0
- Operating System: Windows
- Browser: [All, Chromium, Firefox, WebKit]
- Language: C#
Code Snippet
I am trying to capture JS error on Playwright Page using window.onerror event,
but window.onerror event is not firing during these JS errors.
Does window.onerror event fires automatically if JS errors occur on a playwright page
For example: Pseudo code
window.onerror = function () {
console.log("JS errors captured");
}
str=""; //str is a Javascript with error
try{
PlaywrightPage.EvaluateAsync(str);
}
catch
{
Console.writeLine("Exception occurred");
}
Expected Outcome:
JS errors captured
Exception Occurred
Actual Outcome:
Exception Occurred
Follow up Question
What are other ways to capture JS errors if we open a page on browser launched using Playwright? (Other than window.onerror() )
Context:
Code Snippet
I am trying to capture JS error on Playwright Page using window.onerror event,
but window.onerror event is not firing during these JS errors.
Does window.onerror event fires automatically if JS errors occur on a playwright page
For example: Pseudo code
Expected Outcome:
JS errors captured
Exception Occurred
Actual Outcome:
Exception Occurred
Follow up Question
What are other ways to capture JS errors if we open a page on browser launched using Playwright? (Other than window.onerror() )