ImageExists Method (TestObject)

Class

TestObject.

Action

Returns whether the specified image asset exists.

Syntax

C#
TestObject.ImageExists(imageAsset, [occurrence, searchRectangle])
VB
TestObject.ImageExists(imageAsset, [occurrence, searchRectangle])
Variable Description
imageAsset A .imageasset file. This file must be an embedded resource in the test assembly. 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 .

C# 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");

Visual Basic 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")