ImageExistsFile Method (AnyWin)

Class

AnyWin.

Action

Returns whether the specified image exists.

Syntax

bImageExists = window.ImageExistsFile (sImageFile[, matchAccuracy])
Variable Description
bImageExists Whether the image in the file exists in the AUT or not. BOOLEAN.
sImageFile An absolute path to an image file of one of the following types:
  • .bmp
  • .png
Note: This path can be either absolute or relative to the working directory during playback.
STRING.
matchAccuracy Optional: The accuracy with which the image in the AUT must match the image in the file. The accuracy can be a number between 1 and 10. The default value is 10. Setting this parameter is helpful if you are testing multiple systems or browsers with different screen resolutions. Micro Focus recommends choosing a high level of accuracy in order to prevent false positives. INTEGER.

Example

Assume you have an image with the name myImage.png in the directory C:\temp. To check if the image exists in the application under test, you can use the following code:
bImageExists = window.ImageExistsFile ("c:\temp\myImage.png")