background image
<< Test Cases - Verifying using methods | Test Cases - for RadioList GetItemCount >>
Test Cases - To verify an object using the Verify function
<< Test Cases - Verifying using methods | Test Cases - for RadioList GetItemCount >>
User's Guide
129
5 D
ESIGNING
AND
R
ECORDING
T
ESTCASES
Recording the verification stage
Verify (aActual, aExpected [, sDesc])
aActual
The value to verify.
ANYTYPE
.
aExpected
The expected value.
ANYTYPE
.
sDesc
Optional. A message describing the comparison.
STRING
.
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.
Procedure To verify an object using the Verify function:
1
Select Record/Testcase to begin recording a testcase (or select Record/
Actions if you want to record a verification statement in an existing
testcase) and drive your application to the state you want to verify.
2
When you are ready to record a verification statement, position the
mouse cursor over the object you want to verify, and press Ctrl+Alt.
The Verify Window dialog appears over your application window.
3
Display the Method tab.
The methods for the selected class are listed on the left. Select the
Include Inherited check box to see methods that the class inherits.
4
Select the method that will return the expected value; provide any needed
arguments. You can specify a built-in method or a user-defined method
(as long as it returns a value).
Note To learn how to create custom methods, see "Adding
methods to a class" on page 306.
5
Click OK.
You return to the test application.
6
Complete your testcase.
7
Paste the testcase into your script.
8
In the editor, wrap the Verify function around the method that returns the
expected value as follows: Make the method call the first argument,
specify the expected value as the second argument, and provide an error
message string optionally as the third argument.
See the following for an example.
Example Say you want to verify the number of radio buttons in the
Direction RadioList in the Replace dialog in the Text Editor. There is no
property or method you can directly use to verify this. But there is a method