code: public String takeScreenshot(String baseName) {
          String result = null;
  
          WebDriver d = driver();
  
          if (!(d instanceof TakesScreenshot)) {
              d = new Augmenter().augment(d);
          }
          if (d instanceof TakesScreenshot) {
              TakesScreenshot ts = (TakesScreenshot) d;
              byte[] png = ts.getScreenshotAs(OutputType.BYTES);
              result = writeScreenshot(baseName, png);
          }
          return result;
      }
docs: Takes screenshot of current page (as .png).
  @param baseName name for file created (without extension),
  if a file already exists with the supplied name an
  '_index' will be added.
  @return absolute path of file created.