romankh3 / image-comparison

Published on Maven Central Java Library that compares 2 images with the same sizes and shows the differences visually by drawing rectangles. Some parts of the image can be excluded from the comparison. Can be used for automation QA tests.

Home Page:https://t.me/romankh3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Questions about flaky comparison results

jradom opened this issue · comments

Hello,

I use your tool and it had worked great for me until now. Here Is my scenario.
I have an app that is going through an upgrade.

  1. I make screenshots using Selenium for several pages and store them as baseline images (before the upgrade).
  2. I run my app after the upgrade and make screenshots of the same pages
  3. I compare on the fly each new and old/baseline pages and use .setAllowingPercentOfDifferentPixels(10)
  4. Sometimes my result is MATCH or MISMATCH or SIZE_MISMATCH and its' random

What can you suggest to make it work stable?
Oh, differences in fact are minimal. I use the Chrome browser to run my app

Your help will be greatly appreciated

Thanks a lot in advance

Jeff

Hi @jradom,
Firstly, setAllowingPercentOfDifferentPixels(10) is a really powerful configuration, which was added for you (as I remember).

I'd suggest starting comparing without this config, it's for different MISMATCH and MATCH

If we speak about SIZE_MISMATCH - it's harder. Before say something I need to reproduce it. From my perspective, if you have this result, it means, that the screenshots are not the same.

Hope, it was helpful for yiu.

SIZE_MISMATCH means, that the image sizes are different. For example:
image1 has 100x1000 pixels
image2 has 101x1000 pixels
In this case, would be SIZE_MISMATCH

Best regards,
Roman

I don't know for sure how selenium works, that's why I can't help with it.
Also, I'm not familiar with automation testing tools and approaches. I'm a developer, not qa engineer..
I wish I can help you...

Roman,

I've just downloaded your Jar file but how can I run it, put parameters and output. Like I said I plan to call CLI from Typrescript

Please, let me know

Thanks a lot in advance

Jeff

Jeff,
This jar of image-comparison doesn't have main method to run as a jar.
For this purpose must be created the separated project with the main method with image-comparison as a dependency.