Custom Servers

For each custom control that you want to support, you develop a custom server class, that derives from the CustomServerBase class. The resulting custom server DLL runs in the context of the application and interfaces between UFT One and the custom control. At UFT One's request, it can retrieve the values of identification properties from the control, perform operations on the control, determine what steps to record in response to user activity on the control and so on. You can compile more than one custom server into a single DLL.

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 Micro Focus Support.

You implement each of these abilities by implementing the relevant interface in the custom server class:

  • To support running test object operations, you develop a run interface that contains the methods that run the operations you defined in the test object configuration file. You must tag this interface with the RunInterfaceAttribute attribute.

  • To support retrieving identification property values from the control, you develop a property interface that contains properties that retrieve the values for the identification properties you defined in the test object configuration file. You must tag this interface with the CustomPropInterfaceAttribute attribute.

    Note: In the test object configuration file, you must define all identification properties relevant for your test object class. However, the implementation for retrieving the property values is inherited from the base class for any properties that it supports.

  • To support table checkpoints and output values, you implement the methods in the ITableVerify interface.

  • To support recording, you implement the IRecord interface.

  • To instruct UFT One to ignore children of a control (because they are functionally part of the control, and not independent controls themselves), design the IsKnownPartOf method in the IComponentDetector interface to return true for those child controls.

For task details, see How to Develop a Custom Server.

When you design your custom server, you can use utility methods and properties provided by the WPF Add-in Extensibility API. For details, see Utility Methods and Properties.

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.

You implement each of these abilities by implementing the relevant interface in the custom server class:

  • To support running test object operations, you develop a run interface that contains the methods that run the operations you defined in the test object configuration file. You must tag this interface with the RunInterfaceAttribute attribute.

    When developing support for a Silverlight control, you must tag each one of the methods that you design to implement running a test object operation with the Microsoft Silverlight ScriptableMember attribute.

  • To support retrieving identification property values from the control, you develop a property interface that contains properties that retrieve the values for the identification properties you defined in the test object configuration file. You must tag this interface with the CustomPropInterfaceAttribute attribute.

    Note: In the test object configuration file, you must define all identification properties relevant for your test object class. However, the implementation for retrieving the property values is inherited from the base class for any properties that it supports.

  • To support table checkpoints and output values, you implement the methods in the ITableVerify interface.

  • To support recording, you implement the IRecord interface. (Use this link for information on the IRecord interface in the Silverlight API.)

  • To instruct UFT One to ignore children of a control (because they are functionally part of the control, and not independent controls themselves), design the IsKnownPartOf method in the IComponentDetector interface to return true for those child controls.

For task details, see How to Develop a Custom Server.

When you design your custom server, you can use utility methods and properties provided by the WPF or Silverlight Add-in Extensibility API. For details, see Utility Methods and Properties.