Each class has a set of methods associated with it, including built-in verification methods. You can verify an object’s state using one of these built-in verification methods or by using other methods in combination with the built-in Verify function.
A class’s verification methods always begin with Verify. For example, a TextField has the following verification methods; VerifyPosition, VerifySelRange, VerifySelText, and VerifyValue.
Verify (aActual, aExpected [, sDesc])
Usually, the value to verify is obtained by calling a method for the object being verified; you can use any method that returns a value.
This example describes how you can verify the number of option buttons in the Direction RadioList in the Replace dialog box of the Text Editor. There is no property or method you can directly use to verify this. But there is a method for RadioList, GetItemCount, which returns the number of option buttons. You can use the method to provide the actual value, then specify the expected value in the script.
When doing the verification, position the mouse pointer over the RadioList and press Ctrl+Alt. Click the Method tab in the Verify Window dialog box, and select the GetItemCount method.
Click OK to close the Verify Window dialog box, and complete your test case. Paste it into a script. You now have the following script:
testcase VerifyFuncTest () TextEditor.Search.Replace.Pick () Replace.Direction.GetItemCount () Replace.Cancel.Click ()
Verify (Replace.Direction.GetItemCount (), 2)
That is, the call to GetItemCount (which returns the number of option buttons) becomes the first argument to Verify. The expected value, in this case, 2, becomes the second argument.
Your completed script is:
testcase VerifyFuncTest () TextEditor.Search.Replace.Pick () Verify (Replace.Direction.GetItemCount (), 2) Replace.Cancel.Click ()