background image
<< Class Hierarchy - Defining new verification properties | Class Hierarchy - Defining new attributes >>
Class Hierarchy - To make the NumChildren class property
<< Class Hierarchy - Defining new verification properties | Class Hierarchy - Defining new attributes >>
310
User's Guide
16 E
XTENDING
THE
C
LASS
H
IERARCHY
Defining new verification properties
Here is the class property definition:
property NumChildren
INTEGER Get ()
return ListCount (GetChildren ())
That property returns the number of children in the object, as follows:
·
The built-in method GetChildren returns the children in the dialog box in
a list.
·
The built-in function ListCount returns the number of elements in the list
returned by GetChildren.
To make the NumChildren class property available to the verification system
(that is, to also make it a verification property) you list it as an element in the
variable lsPropertyNames. So here is part of the extended DialogBox
declaration that you would define in an include file:
winclass DialogBox : DialogBox
// user-defined property
property NumChildren
INTEGER Get ()
return ListCount (GetChildren ())
// list of custom verification properties
LIST OF STRING lsPropertyNames = {"NumChildren"}
Now when you verify a dialog box in a testcase, you can verify your custom
property: