I want to be able to find javascript errors on a web page during selenium testing, I am using selenium remotewebdriver, nunit and c#.
I was reading into a technique where you embed javascript into every page to check if there are any javascript errors present, and create a message using html to show that there is an error. This way, selenium can verify if there are any errors by checking if the message exists. But this way seems pretty tedious because you have to write the javascript code on every single page.
Can someone recommend me better way to implement this?