Fuzzy screenshot comparison with Selenium

前端 未结 4 2099
我在风中等你
我在风中等你 2021-02-05 20:22

I\'m using Selenium to automate webpage functional testing. It\'s important for us to do a pixel-by-pixel comparison when we roll out new code, so we\'re using Selenium to take

4条回答
  •  梦毁少年i
    2021-02-05 20:42

    I've been using perceptualdiff which uses a model of the human visual system to try to avoid reporting unnoticeable changes (the authors used for renderer regression testing). Usage is quite simple:

    perceptualdiff -output diff.ppm baseline.png test.png
    

    (where diff.ppm is a PPM format image highlighting the areas of difference)

    The needle regression testing framework has support for using pdiff to compare screenshots:

    http://needle.readthedocs.org/en/latest/#engines

提交回复
热议问题