Part 10: Usages Of Javascripts In Selenium: How To Capture Screenshot Of Entire Web Page

Hello Folks,

When we capture screenshot using “TakesScreenshot” interface in selenium webdriver, it captures only visible area of webpage in browser, not entire web page. Sometimes, you need to capture entire web page for test result proof or for validation at later stage. In this post, I will explain how can we capture a web page, page by page in selenium webdriver using javascript methods.

In last post, we have learnt how to scroll a web page, page by page. We will use same concept and will call screen capture method after each scroll.

Java Code:

Output:
After running program successfully, you will see screenshots at specified location as below:

That’s it guys in this post. We will see some more interesting thing about scroll in up coming posts.

If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe.
#ThanksForReading
#HappySelenium

Leave a Reply

Your email address will not be published. Required fields are marked *