| || |
Reg: Dynamic image comparision
Is there any way to compare two images dynamically in qtp.?That is, capture a screen image during the run time and after moving to another tab capture image of same screen and compare with first image. Any other option is available without using Image checkpoint.?
The below script is not working for me. The below code is giving always "Not same". But both the images are taking in run time are same.
fileExp = "C:\expected.bmp"
object.image1.capturebitmap fileExp, true
fileAct = "C:\actual.bmp"
object.image2.capturebitmap fileAct, true
set oCompareUtil = CreateObject("Mercury.FileCompare")
if oCompareUtil.IsEqualBin(fileExp, fileAct, 0, 1) then
Msgbox("They are the same")
Msgbox("They are NOT the same")
set oCompareUtil = Nothing
Re: Reg: Dynamic image comparision
The Mercury.FileCompare API does not allow any variation in the images. I have used Tarun's tool for this type of comparison:
With it you can allow a 5% variation in the images, for example.
<font color="#6B6B6B">Scott Genevish
Principal Consultant Designed Quality