Home > Automation Testing > Code to perform Image comparison in protractor

Code to perform Image comparison in protractor

To perform image comparison in GUI Testing we need to install protractor-image-comparison module it can be installed using below command.

Open command prompt and run below command.

Add below code in onPrepare function of configuration file

Code to do image comparison

ImageName is image file name exist in baseline folder. If image is not there in baseline folder then it will create file with name “ImageName” as autoSaveBaseline: true.

Example:

This Article is TAGGED in , . BOOKMARK THE permalink.

Avatar photo
Amit Bharamasali
Automation Software Test Engineer. Skills: Manual Testing, Selenium, Java, Protractor, JavaScript, Katalon Studio, Groovy, Appium, Sahi, Sahi Script and UI/UX testing.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">