Open topic with navigation
The CustomServerBase class, which your custom server extends, includes a UtilityObject property that returns an object that provides utility methods and properties. You can call the following methods and properties in your custom server implementation.
Note: The links in this section link to the Mercury.QTP.WPF.CustomServer namespace section in the Custom Server API Reference. For the most part, the information there is relevant for Silverlight as well, and is identical to the information provided in the Mercury.QTP.Slv.CustomServer namespace section. An alternative link is provided for the Silverlight information when it is significantly different.
AddHandler. Registers an event handler to use when an event occurs on the control. The handler is added at the beginning of the event handler invocation list for this event.
Mouse and Keyboard operation simulation methods. Use these methods in methods that perform steps on a control.
Record. Adds a step to the test and adds a test object to the object repository if it is not already there. Use this method in an event handler that records a step in a test after an event occurs on a control.
ReportStepResult. Adds information about the results of a step to the run results. Use this method in a method that performs a step on a control.
ThrowRunError. Throws an exception based on the specified error and sets the step status to EventStatus.EVENTSTATUS_FAIL.
ApplicationObject. This property returns the control object with which the custom server is associated. For example, for a CheckBoxCustomServer associated with a check box, this property returns a reference to the check box. You can then use this reference to retrieve information (for example the value of the IsChecked property), or to perform some activity on the control (for example set its IsChecked property to