Utility Methods and Properties

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.

Silverlight extensibility:

  • UFT One 2022 and later: Following the discontinuance of the Silverlight development framework, UFT One no longer supports the Silverlight Add-in out of the box.

    If you need to use and extend the Silverlight Add-in, contact OpenText Support.

  • The links in this section link to the Mercury.QTP.WPF.CustomServer namespace section in the Custom Support 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. (Use this link for information on the AddHandler method in the Silverlight API.)

  • Mouse and Keyboard operation simulation methods. Use these methods in methods that perform steps on a control.

  • GetSettingsValue, GetSettingsXML. Retrieve settings defined for this custom server in the toolkit configuration file.

  • 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 true).