Forum Discussion

jsc's avatar
jsc
Regular Contributor
13 years ago

region comparisons still fail

Hi all,



I got another problem and I right now have no idea what the solution could be.



I thought that I had considered all parameters for region comparisons but still screenshots look different on my 2 systems.

The screenshots of the "normal" part of the tested software pass the tests, but screenshots made of the part of the software, that has some sort of Internet Explorer 9 as base still differ.



The following paramters are identically on both systems:


  • windows theme = windows klassisch aero

  • resolution = 1280 x 1024

  • color depth = 16 bit

  • clear type = off

  • IE9: software rendering = activated


Can anybody look at the screenshots and help me?

I do not want to add high values to pixel / color tolerance.



Thanks,



Joachim

6 Replies

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Joachim,



    The image comparison fails due to font smoothing in the IE 9 screenshot (on the right). It's a known problem with Internet Explorer 9, which always uses font smoothing regardless of Windows settings and doesn't have an option to turn it off.



    A possible solution is to roll back to IE 8, which supports turning off font smoothing. There's also a hacky workaround, which involves registry tweaking and placing two extra DLLs in the IE 9 folder.



    If neither is an option, I'm afraid, you'll have to resort to using pixel tolerance, as explained in Ignoring a slight difference between images.
  • jsc's avatar
    jsc
    Regular Contributor
    Hi Helen,



    thanks for your answer.

    The problem is, that all settings are the same on my local pc (where tests are written / recorded) and the pc where the tests are run.

    So with your explanation the fonts should be smoothened on both pcs (which would be ok for me, as long as they look the same!) but not just on the running system. But on my pc the fonts are sharp as shown on the left picture of the attached file.

    So I do not get why the fonts on my pc are sharp! Can you explain this?



    So would one possible solution then be to activate cleartype in windows (and update all screenshots)?

    If it is sure that the pictures then would look alike I would do this. If it's not sure, rather not, as it would be quite much work.



    Kind regards,



    Joachim
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Joachim,



    The screenshots of the "normal" part of the tested software pass the tests, but screenshots made of the part of the software, that has some sort of Internet Explorer 9 as base still differ.

    ...

    The problem is, that all settings are the same on my local pc (where tests are written / recorded) and the pc where the tests are run.


    The problem is not in your system settings, they are fine. The problem is in the way the "IE 9" part of your AUT renders the fonts. As I said in my previous post, IE 9 -- both stand-alone and integrated into your AUT -- uses font smoothing even if it's disabled system-wise. Smooth fonts are rendered with mixed colors, and this causes problems with pixelwise image comparisons.



    I guess, the baseline screenshot (the one on the left, with sharp fonts) was captured from either the "normal" part of your AUT, or an earlier IE version (e.g. 6) that doesn't have the described issue. That's why, the font rendering in the baseline and actual screenshots differs, and the comparison fails.





    So would one possible solution then be to activate cleartype in windows (and update all screenshots)?


    No, you need to use sharp fonts to compare images, because they provide a more stable image comparison, while smooth fonts do not.



    To work around the font smoothing issue in the "Internet Explorer" part of your AUT, you can use one of the following:

    ā€“ Use this technique to disable font smoothing in IE 9 (both stand-alone and integrated in your AUT) on all machines where the test is run. This should make fonts in the "IE" part of your AUT sharp like on the left picture.

    ā€“ Downgrade from IE 9 to IE 8 on all machines where this test is run, and turn off its ClearType in Internet Options > Advanced > Multimedia. This should also make fonts in the "IE" part of your AUT sharp.

    If neither is an option for you, you'll have to set the pixel and color tolerance for the checkpoints in order for the "IE" screenshots to pass the check.





    Having said that, may I ask you what you are using region checkpoints for at all? If your goal is to compare some text in the images, there are way more effective solutions like getting the text using methods and properties of the test objects in your application, Text Recognition, etc.
  • jsc's avatar
    jsc
    Regular Contributor
    Hi Helen,



    thanks for your help.



    I think your explanation does not explain the problem I had:

    My two systems are identical regarding settings and all stuff. The picture was taken in system 1 and passes in this system. But on system 2 the comparison fails...



    I turned on cleartype on both systems, updated all pictures and now everything is ok and works fine. (was quite annoying work though)



    I am using region checkpoints as I am not only checking the text within pictures or fields, but also checking if all the layout is correct.

    With region checkpoints I can handle all with 1 checkpoint.

    Is there a better / easier way to do this?



    Kind regards,



    Joachim
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Joachim,



    OK, I'm glad to hear it's working fine now. Sorry for the confusion around your issue.



    I am using region checkpoints as I am not only checking the text within pictures or fields, but also checking if all the layout is correct.

    With region checkpoints I can handle all with 1 checkpoint.

    Is there a better / easier way to do this?


    It's difficult to say without knowing the specifics of your application under test. Depending on the app, a better option may be to create an object checkpoint for the parent container along with child objects representing individual controls and verify property values such as Left, Top, Height, Text/wText, etc. for all the needed objects. Personally, I would prefer to rely on property values rather than on images, but it's up to you.