code: public static boolean isSimilarToScreenshot(IElement element, File controlPicture, File
  			toSaveAs, double threshold) throws IOException, WidgetException {
  		
  		takeScreenshotOfElement(element, toSaveAs);
  		
  		log.info("Screenshot was successful. Comparing against control...");
  
  		BufferedImage var = ImageIO.read(toSaveAs);
  		BufferedImage cont = ImageIO.read(controlPicture);
  		
  		return isSimilar(var, cont, threshold);
  	}
docs: *
  Prereq: The page on which you are taking the screenshot is fully loaded
  
  Take a screenshot of the element identified by element and save the file as toSaveAs
  (Note that this file should be saved as a png).
  Test that the control picture, controlPicture, is both the same size as,
  and, has a similarity value greater than or equal to the threshold.
  
  @param element - the element to be tested
  @param controlPicture - the file of the picture that will serve as the control
  @param toSaveAs - for example, save the file at "testData/textFieldWidget/screenshot.png"
  @param threshold - you are asserting that the similarity between the two pictures
  is a double greater than or equal to this double (between 0.0 and 1.0)
  @throws IOException
  @throws WidgetException