WaitForScreenshotStable Method (AnyWin)

Class

AnyWin.

Action

Waits until the object is visually stable and does not change its position, by comparing screenshots taken with the specified interval. An exception is thrown if the timeout is reached.

Availability

This method is supported only in scripts that use the Open Agent and dynamic object recognition.

Syntax

WaitForScreenshotStable ([timeout, interval])
Variable Description
timeout Optional: The maximum wait time in seconds. NUMBER.
interval Optional: The interval between screenshots in seconds. The default value is 0,2 seconds. NUMBER

Notes

  • This method can be very useful in cases where the AJAX synchronization does not work, for example for CSS transitions.
  • An E_REPLAY_TIMEOUT exception is thrown if the timeout is reached.
  • If no timeout is specified, the timeout specified by the option OPT_WAIT_RESOLVE_OBJDEF is used.

Example

The following example waits for a CSS transition to complete. The interval between screenshots is 0,1 seconds:

domElementWithCssTransition.WaitForScreenshotStable(5,0.1)