WaitForProperty Method (TestObject)

Class

TestObject.

Action

Waits until the specified property has the specified value or until the timeout is reached.If you don't explicitly pass a timeout using the optional timeout parameter, the timeout specified by the option OPT_WAIT_RESOLVE_OBJDEF will be used. An exception is thrown if the timeout is reached.

Syntax

testObject.WaitForProperty(propertyName, expectedValue, [timeout])
Variable Description
propertyName The name of the property. String.
expectedValue The value of the property to wait for. Object.
timeout Optional: The maximum wait time in milliseconds. Integer.

Examples

The following example waits for a button to be enabled:
button.WaitForProperty("Enabled", true, 10000)
The next example waits until the caption of a dialog that indicates the completion of an operation is available:
dialog.WaitForProperty("caption", "Operation Complete")

Note: To get the entire list of the available properties for a control, use the GetPropertyList method.