public BufferedImage takeScreenshot(){
  Debug.setDebugLevel(3);
  File scrFile=driver.getScreenshotAs(OutputType.FILE);
  BufferedImage bufferedImage=null;
  try {
    bufferedImage=ImageIO.read(scrFile);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return bufferedImage;
}

public BufferedImage takeScreenshot ( ) { Debug . setDebugLevel ( 3 ) ; File scrFile = driver . getScreenshotAs ( OutputType . FILE ) ; BufferedImage bufferedImage = null ; try { bufferedImage = ImageIO . read ( scrFile ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return bufferedImage ; }
convenience method that takes a screenshot of the device and returns a bufferedimage for further processing .
