Is there a way to capture errors occurring in the DOM in Selenium and probably flag the same as an error in the page?
DOM
Selenium
To give a brief exam
JSErrorCollector does the job.
Once configured, it's a matter of:
List jsErrorList = JavaScriptError.readErrors(driver);