How to take screenshot of complete webpage in Ranorex

Best practices, code snippets for common functionality, examples, and guidelines.
kkashyap1707
Posts: 10
Joined: Tue Jul 29, 2014 1:19 pm

How to take screenshot of complete webpage in Ranorex

Post by kkashyap1707 » Thu Aug 21, 2014 1:01 pm

Hi,
I wants to capture screenshot of complete webpage in Ranorex .Please help me how to capture the screenshot of complete webpage. As of now Ranorex captures only visible part of the webpage.Please help me out.
Waiting for reply.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to take screenshot of complete webpage in Ranorex

Post by krstcs » Thu Aug 21, 2014 2:32 pm

Ranorex can only capture the screen shot of the parts of the application or webpage that are visible on the screen.

If you need to capture the whole page you, there are a few options:

1. Change the ZOOM level of the browser so that the whole page is visible in the browser's rendering frame. Then take a screenshot of the page and return the ZOOM back to normal (although you don't really have to do this on Ranorex's account).

2. Take multiple screenshots, scrolling down in-between each one. You would need to write some user code that would manage this, or if you know that there is an element at the bottom of the page that is always there, you could just add an "EnsureVisible" action on that element, and Ranorex should scroll the page down automatically. This only works if the page is small enough to only have two folds. If the page is longer than two screens, then you could find multiple objects, one in each "section" (probably would want them to overlap a bit).

I would probably go for option 2, but write code that checks how long the page is, how long the fold/view size is, and then scrolls down until there are no more folds, taking a screenshot in each section.
Shortcuts usually aren't...