GXtest UI Commands - CompareImage

Official Content
This documentation is valid for:

CompareImageWebCommand

Compares the second image against the first one. Returns the percentage similarity as an integer number, returning 100 if the images are equal. Images must have similar scaling in order for the comparison can be performed.

Parameters

  • OriginalImagePath (Character): the path of the image you want to compare the new image against.
  • NewImagePath (Character): the path of the image you want to compare against the original.

Returns

  • An integer value between 0 and 100 that represents the similarity percentage between the images compared. Equal images return 100.

Example

&driver.Verify(&driver.CompareImage("C:\screenshot1.png","C:\screenshot2.png") > 95, true, "Comparing screenshots")

Availability

This command is available since GeneXus 17 upgrade 6.