Solved
Forum Discussion
17 Replies
Sort By
- HKosova
Alumni
- muthulakshmiOccasional Contributor
I'm getting blank page while using page.PagePicture method. Kindly help.
Function TakeFullScreenshot(page) Dim screenshot screenshot = Project.Variables.REPORTPATH&"\\" & aqConvert.DateTimeToFormatStr(aqDateTime.Now(), "%m%d%Y_%H%M%S") & ".jpg" page.PagePicture().SaveToFile screenshot TakeFullScreenshot = screenshot End Function
- AlexKaras
Champion Level 2
Hi,
Just to be on the safe side: does the page exist and is rendered in the browser when you are taking screenshot?
Can you provide a code snippet that calls TakeFullScreenshot() function?
- AlexKaras
Champion Level 2
Hi Tanya,
While I understand that this is a complex task (even SnagIt not always captures the scrolling window entirely;). For example, I failed to capture the macro window in ABS to get a screenshot to illustrate the macro logic:) ), I think that the only control(s) involved is/are scrollbars.
To my understanding, the code must:
-- Take a screenshot of the visible window area (window frame);
-- Scroll down (or to the right) for the size of the window frame;
-- Take another screenshot and append it to the previous one;
-- Repeat until scrollbars reach their end position (the size of the captured frame must be adjusted for the last screenshot(s).
Drew Wells posted a sample code for web pages some time ago that may be used as a reference for my description. I tried to port it to work with native Windows application but did not succeed with scrolling window content using toolbars.
http://blog.smartbear.com/software-quality/bid/170340/
http://blog.smartbear.com/software-quality/bid/170341/
Just my opinion which may be incorrect. :) - irina_lukinaSuper Contributor
Hi,
You can access the web page from your test using the following syntax:
// Obtain the browser process
var browser = Sys.Browser("iexplore");
// Obtain the page currently opened in Internet Explorer
var page = browser.Page("*");
For more information on the mentioned approach, please refer to the Common Tasks for Web Testing help topic.Also, if you need to access the page's scroll bar, I recommend that you use the ScrollBar program object.
Does this information help?
- achandContributorI want to get a screenshot for whole page. When I use Log.Picture to capture screenshot for tested webpage, it only captures page which is visible but not whole page.
I need a way within TestComplete which will allow me to capture a screenshot of whole webpage. - achandContributorNote: The web page is longer than the browser window and I need a
screenshot that captures the full body of the web page - achandContributorHelen,
It worked. thanks!! - AlexKaras
Champion Level 2
Hi Helen,
It is my understanding that Page.PagePicture method works for web pages only.
Haven't you occasionally met the code that can do the same (i.e. capture the whole contents of the scrolling window) but for the regular Windows application window? - HKosova
Alumni
Hi Alexei,
You're right, the PagePicture method is only for web pages.
We don't have script examples of how to capture other types of scrollable windows, as it's a non-trivial task. However, there are third-party utilities that can do this, for example, DuckCapture (free). So, I recommend using these utilities in your tests. - AlexKaras
Champion Level 2
Hi Helen,
Yes, I know that the task is not trivial as I already tried to implement it several times without any real success. :) So I thought maybe you have something relevant... :)
Thank you for the link provided, unfortunately, DuckCapture seems do not capture scrolling Win32 windows (at least on the 64-bit OS).
Will continue considering script or plug-in -based implementation... - sbkeenanFrequent ContributorHi
The ability to capture scrolling windows within a Windows application is something that I would find very useful too. It would be especially useful as an option in the checkpoint wizard.
Is there any possibility that this will be implemented in a future release of TestComplete.
If there is a customer vote on this, please add my vote!!
Many thanks.
Regards
Stephen.