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.
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
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