Micro Focus QTP (UFT) Forums
Bitmap Checkpoint - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Bitmap Checkpoint (/Thread-Bitmap-Checkpoint)



Bitmap Checkpoint - balaji4u - 06-30-2010

Hi All ,

I have a requirement which goes like this.
My application is a windows application and i have a functionality which triggers a picture when a windows menu is clicked so i have to verify whether the picture appears the same each time when i click the Menu , so i am using the Bitmap checkpoint . But i am facing a problem here the picture has a very less time out so as soon as i click the menu the picture appears and disappears in 2 seconds so i am not able to switch to QTP and add a checkpoint for the picture . Can anyone propose a workaround for this . Is there any HOTkey associated with the Bitmap checkpoint so that i can capture the Bitmap without switching to QTP ...

Regards,
Balaji


RE: Bitmap Checkpoint - Tarik Sheth - 06-30-2010

I can suggest the following:

As soon as you click on the Menu also clcik on the print screen and see whether it captures the image also save it in a particular location.

Make sure you have a reference image to check with.
You can try below mentioned code for image verification.

Code:
Browser("Browser").Page("Page").WebTable("Table1").CaptureBitmap "c:\Temp1.jpg"
Browser("Browser").Page("Page").WebTable("Table2").CaptureBitmap "c:\Temp2.jpg"

Dim WshShell, oExec

Set WshShell = CreateObject("WScript.Shell")

Set oExec = WshShell.Exec("fc /b c:\temp1.jpg c:\temp2.jpg")

output = oExec.StdOut.ReadAll()

If Instr(1,output, "no differences in the two image", 1) Then
//  Pass Test
Else
// Fail Test
End If

I would say this is not the accurate method to check images through QTP. Also this might fail when run on the different machine because of
Screen resolution, color palette, vga, internal bit signatures may be different

If you like to compare all the image properties like color Pallate, darkness, brighness, hue etc.. then there is a method in dotnet library which compares the image. you need to use dotnetlibrary method to access the dll which will compare any two image file and produce the result.

Please 'dotnetlibrary' method as 'dotnetfactory' method