VerifyContents Method (Menu MenuItem MoveableWin)

Class

Menu, MenuItem, and MoveableWin.

Action

Verifies the contents of the menu or window.

Availability

This functionality is supported only if you are using the Classic Agent.

Syntax

object.VerifyContents(lsExpected[, nTimeout])
Variable Description
lsExpected The expected contents of the menu or window. LIST OF STRING.
nTimeout Optional: The number of seconds to wait for the expected value to be achieved. NUMBER.

Notes

VerifyContents checks that the contents of the menu or window match the list of string passed in. If the contents do not match, Silk Test Classic raises the exception E_VERIFY.

Calling this method is the same as calling the Verify function in the following manner:
Verify(object.QueryContents(), lsExpected, "contents")

(QueryContents is an internal method for Menu and MoveableWin, defined in winclass.inc.)

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyContents() 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

list of string lsContents
lsContents = xTextField.QueryContents()
ListWrite(lsContents, "QueryContents.txt")
xTextField.VerifyContents(lsContents)