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.
Step-1: Download from the following link and extract it wherever you want. Step-2: Set E:\Softwares\ImageMagick-6.8.9-8 in path environment variable
Maven Dependency
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 *