Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bitmap Checkpoint
#1
Solved: 11 Years, 4 Months ago
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
Reply
#2
Solved: 11 Years, 4 Months ago
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  bitmap checkpoint ch_rk2004 0 1,621 07-16-2015, 05:15 PM
Last Post: ch_rk2004
  Capture tooltip text through bitmap checkpoint Nicklas 3 4,610 10-09-2012, 07:35 PM
Last Post: Brian.Osborne
  Bitmap Checkpoint is not recorded correctly hptrinh 1 2,610 04-11-2012, 07:55 PM
Last Post: hptrinh
  Bitmap Checkpoint nacchio 1 2,925 09-29-2011, 08:22 PM
Last Post: rajpes
  Bitmap Comparison Algorithm by creating Custom comparer remya 1 4,777 01-19-2011, 03:16 PM
Last Post: john

Forum Jump:


Users browsing this thread: 1 Guest(s)