Automation Testing – Comparing Screenshots

Suppose if you want to compare the screenshot (source) which was captured in your last automated test execution with the current execution screenshot (target), then you can go with imagemagick tool. It provides the difference in a file after a comparison and is very helpful for automation testing. You can also use ImageMagick to compare two different images through command line if you have any test cases for manual testing. Let’s see how to compare source and target images and get the difference using ImageMagick with an example code.
Installation
Step-1: Download ImageMagick-6.8.9-8-Q16-x86-windows.zip from the following link http://ftp.icm.edu.pl/packages/ImageMagick/binaries/ and extract it wherever you want. Step-2: Set E:\Softwares\ImageMagick-6.8.9-8 in path environment variable
Maven Dependency
Code
You can also explore AppliTools Automated Visual Web & Mobile Testing to take your image comparsions to the next level.

Leave a Reply

Your email address will not be published. Required fields are marked *