Some of the webpages exceed the height of the browser and require use of scrollbars to view the contents in the bottom of the page.
This influences creation of screenshots of the pages: concealed contents are not visible at the point of making a screenshot via the
Picture
method.
In this recipe we will learn how to create screenshots regardless of the dimensions of the window in the browser.
To create the screenshot of the whole of the webpage:
var br = Aliases.browser; br.ToUrl("http://smartbear.com"); var page = br.pageMain;
PagePicture
method we will save the screenshot of the page to the log:Log.Picture(page.PagePicture());
The method of PagePicture
automatically scrolls the page making screenshots of its parts, and then automatically splices them to make a screenshot of the whole of the page.
Please note that, unlike the Picture
method, the PagePicture
method creates the screenshot of the page alone, and not that of the whole screen. This means: if there's a window on screen at the moment the screenshot is made (for example, an error alert that impacts work of the tested application), the screenshot will not show the window.
3.144.15.43