Make Selenium Easy

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:

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.

Table of Contents

Author: Amod Mahajan

A software Tester who is paid to judge products developed by others. Currently getting paid in American Dollars. Writing technical posts and creating YouTube videos are my hobbies.

Leave a Reply

Please wait...

Subscribe to new posts to become automation expert

Want to be notified when my new post is published? Get my posts in your inbox.