ImageExists Method (TestObject)

Class

TestObject.

Action

Returns whether the specified image asset exists.

Syntax

TestObject.ImageExists(imageAsset, [occurrence, searchRectangle])
Variable Description
imageAsset The name of the image to click on. String.
occurrence Optional: The occurrence of the image that should be clicked, if there are multiple occurrences. The first occurrence is 1. The default value is 1. Integer.
searchRectangle Optional: The object-relative rectangle in which to search for the image. Rect .

Example

Assume you have created an image asset with the name myImage. The image in the image asset represents a UI object that you want to interact with. To check if the image exists in the application under test, you can use the following code:
 control.ImageExists("myImage")