I am working on "selenium webdriver" with java. I can switch to iframe. I can read the Element which is inside iframe. But i want to take the screenshot of Element which is inside iframe. Am using the following code. Its not take screenshot inside iframe element. There is any solution for this.
File screenshot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
BufferedImage fullImg = ImageIO.read(screenshot);
Point point = ele.getLocation();
int eleWidth = ele.getSize().getWidth();
int eleHeight = ele.getSize().getHeight();
BufferedImage eleScreenshot= fullImg.getSubimage(point.getX(), point.getY(), eleWidth,eleHeight);
ImageIO.write(eleScreenshot, imageType, screenshot);