title: Selenium Webdriver - Capture URL in screenshot using Robot
body: <pre><code>Robot robot = new Robot();
  BufferedImage screenShot = robot.createScreenCapture(new 
  Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
  ImageIO.write(screenShot, "JPG", new File("ScreenShot.jpg"));
  </code></pre>
  
  <p>This code will capture the screenshot of whatever is present on the desktop screen when test cases fail. But I need to take screenshot of chromedriver browser screen with URL. How can I capture the error scenario in selenium?</p>