background image
<< Test Cases - Bitmap Agent options | Test Cases - To verify an object using the Verify function >>
Test Cases - Verifying using methods
<< Test Cases - Bitmap Agent options | Test Cases - To verify an object using the Verify function >>
128
User's Guide
5 D
ESIGNING
AND
R
ECORDING
T
ESTCASES
Recording the verification stage
Verifying using methods
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.
Using a verification
method
A class's verification methods always begin with Verify. For example, a
TextField has the following verification methods; VerifyPosition,
VerifySelRange, VerifySelText, and VerifyValue.
Procedure To verify an object using a verification method:
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 verification method from the list.
If the method takes arguments, they are displayed.
5
Fill in any arguments as needed and click OK.
6
Complete your testcase.
For example, here is a testcase that verifies that the text in the TextField
Replace.FindWhat is "myText." It uses the built-in verification method
VerifyValue.
testcase VerifyMethodTest ()
TextEditor.Search.Replace.Pick ()
Replace.FindWhat.VerifyValue ("myText")
Replace.Cancel.Click ()
Using the Verify
function
You can use the built-in Verify function to verify that two values are equal
and generate an exception if they are not. Typically, you use Verify to test
something that doesn't map directly to a built-in property or method. Verify
has the following syntax: