Is there a way to capture errors occurring in the DOM in Selenium and probably flag the same as an error in the page?
To give a brief exam
Solution with "window.onerror" didn't work for me.
So I'd like to point out another solution with altering user-extensions.js which helped me:
Can Selenium detect if the page has JavaScript errors?
Main advantage: You don't have to change the page source to do the check.
And here is how to use user-extensions.js:
Using User-Extensions With Selenium-IDE
Note: This solution works only with Firefox