tags:

views:

235

answers:

4

How to capture the Whole web page when using QTP? I am aware of 'CaptureBitmap' method for the screenshot. But how to capture the Whole page? Help !!

+1  A: 

What do you want to capture? If it's the HTML you can create a checkpoint on the Page test object and check the HTML source checkbox in the HTML verification section.

If you want to capture an image of the page then you can only capture the visible part with CaptureBitmap there is no way to get an image of the scrolled out parts (unless you scroll and use multiple captures).

Motti
A: 

Use Browser("").Capturebitmap.

This takes the screenshot of the visible browser. Use the sendkeys method to do a page down, then use Browser("").Capturebitmap again!

sreeram
A: 

If you would like a single screenshot of the whole page, try using SnagIt.

There's a handy PDF with more info on how to go about it (http://download.techsmith.com/snagit/docs/comserver/enu/snagitcom.pdf)

In QTP it might look like this:

Sub Capture_Scroll_Image ()

Set objShell = CreateObject("WScript.Shell")
Set oSnag = CreateObject("SNAGIT.ImageCapture")

oSnag.IncludeCursor = False
oSnag.OutputImageFile.FileType = 5
oSnag.OutputImageFile.FileNamingMethod = 1
oSnag.OutputImageFile.Directory = "C:\Screens\"
oSnag.OutputImageFile.Filename = "Name"
oSnag.EnablePreviewWindow = False
oSnag.AutoScrollOptions.AutoScrollMethod= 1
oSnag.Capture() 

Wait (1)
objShell.SendKeys "{ENTER}" 
capDone = oSnag.IsCaptureDone

Do Until oSnag.IsCaptureDone
Loop 
Set oSnag=Nothing
Set objShell=NothingEnd Sub
End Sub
quicksilver
This answer does not refer to the question but to a question asked in an answer to the main question. Doh!
TheBlastOne
A: 

Hi,

Is there is any way to compare the pdf file with the online web-page, using VBScript or any other.

Please reply.

rick
Create a new question after browsing existing questions and their answers. Do not ask a question when posting an answer to a question. (Man, this is complicated stuff.)
TheBlastOne