Micro Focus QTP (UFT) Forums
Capture Entire Web page through QTP - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Capture Entire Web page through QTP (/Thread-Capture-Entire-Web-page-through-QTP)



Capture Entire Web page through QTP - learnQtptips - 07-24-2013

Hi,

Could someone please help in capturing the complete/ entire webpage using QTP.

I want to capture the entire webpage beyond the visible part. The work around I have now is capturing the screen using .capturebitmap and scroll bar.
But this doesnt give me a clear screenshot.

I need to capture the entire web page as a single image of any format
Need Help. Please give me some idea which I can try out as well

Thanks


RE: Capture Entire Web page through QTP - Ankur - 07-24-2013

Tarun from KnowledgeInbox has created a utility sometime back . Check if that can help you


RE: Capture Entire Web page through QTP - vinod123 - 07-25-2013


Screen Capture Of Lengthy Web page using Snag IT Scroll Method and QTP
If you have SnagIT and QTP together in your machine, then you will be able to take screen capture of a lengthy web page.

Try the below code and you should have both QTP and SnagIT in your machine. If you don't have SnagIT, please download the trial version of SnagIT and try the code.
Code:
Function Capture_Scroll_Image
Set objShell = CreateObject("WScript.Shell")
Set oSnag = CreateObject("SNAGIT.ImageCapture")

oSnag.Input = 1
oSnag.Output = 2
oSnag.OutputImageFile.FileNamingMethod = 2
oSnag.OutputImageFile.Directory = "C:\Documents and Settings\Desktop"'Make sure to specify your file path where you need to save your screen capture file.

oSnag.EnablePreviewWindow = False
oSnag.AutoScrollOptions.AutoScrollMethod=3
oSnag.OutputImageFile.LoadImageDefaults 5
oSnag.Capture()

wait(2)

objShell.SendKeys "{ENTER}"

Do Until oSnag.IsCaptureDone
Loop

Set oSnag=Nothing
Set objShell=Nothing
End Function
This is the main script
Code:
SystemUtil.Run "Iexplore.exe","http://www.google.co.in"
Browser("name:=Google").Page("title:=Google").WebEdit("name:=q").Set "QTP"
Browser("name:=Google").Page("title:=Google").WebButton("name:=Google Search").Click
Browser("name:=QTP - Google Search").Sync
Call Capture_Scroll_Image 'Calling the function to capture lengthy web page
Browser("name:=QTP - Google Search").Close