Exists Method (TestObject)

Action

Checks if any child object matching the locator exists for an object in the application under test. If the timeout parameter is passed the agent retries finding until the given timeout expires. If no timeout is specified and no object is found initially false is returned immediately.

Syntax

C#
result = testObject.Exists(locator, [timeout])
VB
result = testObject.Exists(locator, [timeout])
Variable Description
result true if a child object with the given locator is found and false otherwise. Boolean.
locator The XPath locator of the child object. Example:

"//PushButton[@caption='ok']"

. String.
timeout Optional: The timeout in milliseconds. If the initial find operation does not match anything the agent retries to find an object until the timeout expires. Integer.