title: Capture console error using JavascriptExecutor class in selenium
body: <p>I am trying to capture browser console error using JavascriptExecutor class in selenium. I am trying it using js function in java code as below. What is the correct way to call this error method from window object inorder to get the console error ? </p>
  
  <p>Code snippet is as below : </p>
  
  <pre><code>            driver = new ChromeDriver();                     
             (JavascriptExecutor)driver).executeScript("window.console.error");
  </code></pre>