IsKnownPartOf Method
Returns true if the child control is an integral part of the parent control, and should not be treated as a separate control.
Implement this method in the custom server. It is called by UFT to determine if an element should be learned, or whether it is part of a higher-level control. If part of a higher-level control, the element is learned as part of that containing control.
A control can be composed of elements, but the properties and behaviors are associated with the control rather than the individual elements. For example, a calendar may contain buttons and listboxes, but the logical behaviors and properties belong to the calendar, not to the buttons and listboxes. For example, the "month" property is a property of the calendar control, not the contained month listbox.
If the control is to be learned as a single unit, the child elements are not learned. In this case, return true for the contained elements.
UFT may call this method for any control, not only on the control that this custom server supports. Therefore, in your implementation, use only the parameters passed to the method. Do not use the UtilityObject or any data members defined in the custom server.
Visual Basic (Declaration) | |
---|---|
Overridable Function IsKnownPartOf( _ ByVal Parent As Control, _ ByVal Child As FrameworkElement _ ) As Boolean |
C# | |
---|---|
virtual bool IsKnownPartOf( Control Parent, FrameworkElement Child ) |
Parameters
- Parent
- A reference to a control supported by the custom server. For example, a calendar control.
- Child
- A reference to a child control of the Parent element.
Return Value
Returns true to indicate to UFT that the child element is not to be learned.C# | Copy Code |
---|---|
public bool IsKnownPartOf(Control Parent, FrameworkElement Child) |