-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.

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.