background image
<< Test Cases - To verify an object using the Verify function | Test Cases - To verify an attribute of a GUI object >>
Test Cases - for RadioList GetItemCount
<< Test Cases - To verify an object using the Verify function | Test Cases - To verify an attribute of a GUI object >>
130
User's Guide
5 D
ESIGNING
AND
R
ECORDING
T
ESTCASES
Recording the verification stage
for RadioList, GetItemCount, which returns the number of radio buttons. You
can use the method to provide the actual value, then specify the expected
value in the script, as follows:
When doing the verification, position the mouse pointer over the RadioList
and press Ctrl+Alt. Select the Method tab in the Verify Window dialog, and
select the GetItemCount method. Click OK to close the Verify Window
dialog, and complete your testcase. Paste it into a script. You now have the
following script:
testcase VerifyFuncTest ()
TextEditor.Search.Replace.Pick ()
Replace.Direction.GetItemCount ()
Replace.Cancel.Click ()
Now use the Verify function to complete the verification statement. Change
the line
Replace.Direction.GetItemCount ()
to
Verify (Replace.Direction.GetItemCount (), 2)
That is, the call to GetItemCount (which returns the number of radio 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 ()
Verifying object attributes
Each kind of GUI object in an application has a variety of characteristics,
called attributes. For example, a text field has the following attributes:
·
Caret position, which is the current position of the text insertion cursor,
in (line, column) format. For example, a value of {1,1} means that the
text insertion cursor is positioned on line 1, column 1.
·
Enabled, which is the current enabled status of the text field, either
TRUE
or
FALSE
.