Facebook

Course Name Start Date Time Duration Registration Link
Cypress JavaScript API Testing 2nd October 2021 9AM - 2PM IST 3 Weekends (30Hours) ClickHere to Register
Please mail To sudhakar@qtpsudhakar.com to Register for any training

Wednesday, June 24, 2009

Compare Two bitmaps using QTP

Dim pTitle

'***************************************************
Function CompareBitmap(ActualBmp, ExpectedBmp)


 Set fCompare = CreateObject("Mercury.FileCompare")


 If fCompare.IsEqualBin(ExpectedBmp, ActualBmp, 0, 1) Then

   Reporter.ReportEvent micPass,"Bitmap Verification",ActualBmp&"and"&ExpectedBmp&" are same"
   CompareBitmap=True
 Else
   Reporter.ReportEvent micFail,"Bitmap Verification",ActualBmp&"and"&ExpectedBmp&" are not same"
   CompareBitmap=False  
 End If


End Function
'***************************************************
'Calling the Function
CompareBitmap "C:\act.bmp", "C:\exp.bmp"
'***************************************************
____________________________________________________________


Please send your Suggestions and Doubts to my yahoo group http://in.groups.yahoo.com/group/qtpsudhakar

No comments :

Post a Comment