-4

When I try to take screenshot of a page using selenium it is not capturing the entire page.

Code snippet:

File file = ((TakeScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(file,new File(location) ;

Note :Happening only sometimes when the page has a scrolling bar.

optimistic_creeper
  • 2,739
  • 3
  • 23
  • 37
Asma
  • 16
  • 2

1 Answers1

0

The problem is probably that the screen size of the computer selenium is running on is smaller than the height of your page. You can explicitly set the size of your browser (here) to how long the page is in driver settings.

Community
  • 1
  • 1
Brydenr
  • 798
  • 1
  • 19
  • 30