How to compare two images
Hello
I've got two images, the location of one of them is on my hard disk and other one has been mapped on my the name mapping of my TC, how can I compare these two images with each other with scripting ?
I looked for the solution in several forums, without any result.
please help me ASAP
Thanks
You can try Picture.Compare (https://support.smartbear.com/viewarticle/72669/) as suggested by somebody else also.
Cosider the following VB Script taken from the above link:
Set imageOnDisk = Utils.Picture 'to obtain empty picture object
Set actualPicOnScreen = (Aliases.page.obj).Picture 'capture yourMappedObj's image
imageOnDisk.LoadFromFile("D:\Data\img1.png")
' Comparing the images using the Compare method
If Not imageOnDisk.Compare(actualPicOnScreen ) Then
Log.Picture imageOnDisk, "Expected Image"
Log.Picture actualPicOnScreen, "Actual Image"
Log.Error "The compared images are not identical"
End IfThank you very much indeed, it works for me