Currently, I am running tests with Selenium web driver using C# and my objective is to ensure that there are no JavaScript errors present on my web pages.
To facilitate this process, I have integrated the JSErrorCollector.xpi
plugin for Firefox and included the following code snippet into my script (sourced from here).
List<object> errors = (List<object>)((_driver).executeScript("return window.JSErrorCollector_errors.pump()");
Assert.IsNull(errors);
However, upon execution, an error message pops up:
window.JSErrorCollector_errors is undefined (UnexpectedJavaScriptError)
I would appreciate any suggestions on how to resolve this issue or if there is a more effective alternative method available.