VerifyFocus Method (Control)

Class

Control.

Action

Verifies that the control has input focus.

Syntax

control.VerifyFocus([nTimeout])
Variable Description
nTimeout Optional: The number of seconds to wait for the control to gain input focus. NUMBER.

Notes

VerifyFocus determines whether the control has input focus, and raises the exception E_VERIFY if it does not.

Calling this method is the same as calling the Verify function in the following manner:
Verify(window.HasFocus(), expected_state)

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyFocus() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option (OPT_WINDOW_RETRY). If the verification fails, an exception is thrown.

Example

TextEditor.Search.GotoLine.Pick()
GotoLine.Line.VerifyFocus()