During my selenium testing, I am looking for a way to identify and locate JavaScript errors on web pages. Currently, I am utilizing Selenium RemoteWebDriver, NUnit, and C#.
I recently came across a method where you can integrate JavaScript into each page in order to detect any existing errors and generate an HTML message indicating the presence of an error. This approach allows Selenium to confirm the absence of errors by checking for the existence of the message. However, this process seems quite laborious as it requires coding JavaScript on every single page.
Would anyone be able to suggest a more efficient technique for achieving this goal?