1

I am trying to take full page (without any scroll bar) screenshots using Selenium in Java. My code below is working perfect in Firefox 29. I tested the same code in Chrome 35 and it is taking partial screenshot (not full page, screen with scroll bar) and IE8 is not supporting screen shots with Selenium Drive.

File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("C://screenshot//" + image1.jpg));
SamK
  • 377
  • 9
  • 27

1 Answers1

0

I don't see any issue on the screenshot in any browsers. For me it takes the full page view.

You can try to use the below approach of using augmenter() which is generally used for RemoteWebDriver execution.

WebDriver augmentedDriver = new Augmenter().augment(driver); 

File f = null; 

if (augmentedDriver instanceof TakesScreenshot) { 
   f = ((TakesScreenshot) augmentedDriver).getScreenshotAs(OutputType.FILE); 
} else { 
    // screenshot not taken
} 
Purus
  • 5,701
  • 9
  • 50
  • 89
  • Thank you for the quick response. When I use augmenter(), the entire screen shot function is not working and no error in console. – SamK Jun 18 '14 at 13:58
  • I found similar post stating there is a bug in new chromedriver (ver 29). [link](http://stackoverflow.com/questions/17885169/selenium-chrome-driver-makes-screenshot-just-of-visible-part-of-page). – SamK Jun 19 '14 at 16:10
  • The bug is still open – Purus Jun 19 '14 at 16:16