Forum Discussion

ozurovich's avatar
ozurovich
Occasional Contributor
14 years ago

Image comparison across platforms

I'm recording scripts on a Windows 2003 server and performing "region" comparisons which saves image files.  

When I play back the scripts on a Windows XP machine, the images don't compare.

Is this something that is expected?

I wonder if 2003 saves images in a different format than on XP?

2 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Tom,



    By design (and according to its name) image comparison basically performs a pure binary pixel-by-pixel comparison of two images.



    That is why it should be used as the last resort only when nothing else works for the given task or when the comparison is done for the same platform with the same GUI settings (color theme, font settings, etc.).



    Different platforms usually use different themes. Thus, at a minimum, you must set graphical subsystems on all platforms to use exactly the same settings. Hovewer, even with the same settings the OS GUI engine can process desktop graphics differently which will result in the failed image comparisons.

    You may use TestComplete's functionality to post a 'difference' image to the log when the image comparison fails to be able to analyse what was the difference between given two images and act correspondingly.

    If this is possible with your tested application, I would recommend to move from image comparison to object/property checkpoints as they are far more reliable and platform independent.

    Also I would recommend to go through the 'How Image Comparison Works' help topic (and related ones) for additional ideas.