code: public static ElementSnapshot shootElement(WebDriver driver, WebElement element, boolean useDevicePixelRatio) {
          Browser browser = new Browser(driver, useDevicePixelRatio);
          ElementSnapshot elementSnapshot = new ElementSnapshot(driver, browser.getDevicePixelRatio());
          browser.scrollToElement(element);
          elementSnapshot.setImage(browser.takeScreenshot(),browser.getBoundingClientRect(element));
          return elementSnapshot;
      }
docs: To be used when need to screenshot particular element.
  
  @param driver  WebDriver instance
  @param element WebElement instance to be screen shot
  @param useDevicePixelRatio whether or not take into account device pixel ratio
  @return ElementSnapshot instance