Mercury.QTP.CustomServer Assembly

Use this reference together with the UFT .NET Add-in Extensibility Developer Guide. The Developer Guide contains full details on implementation, and instructions on how to configure UFT to use your Custom Server.

The following is a brief overview.

The Custom Support Server Class

The main class in a Custom Server project is your custom support server class. This class extends CustomServerBase and implements the custom replay interface.

   public class MyNetCustomSupport :

Implementing Recording

A Custom Server that supports recording implements the IRecord Interface by overriding the callback methods. The methods are overridden in the custom support server class.

If you support recording, define and implement the event handlers required by your test object. In your custom support server class, override InitEventListener and ReleaseEventListener to register and release your handlers. If your Custom Server runs in the UFT (QTP) context, your event listeners extend EventsListenerBase.

To listen directly to Windows messages, implement OnMessage. To get messages for objects other than the custom control, implement GetWndMessageFilter. Define and implement the message handlers required by your test object.

Implementing Test Run

The custom replay interface is marked with the ReplayInterface Attribute. Only one interface in a project can have this attribute.

Define the replay interface according to the requirements of your custom control and implement it in the custom support server class.

If you accepted the suggested name of the Test Run interface when you ran the new project wizard in Visual Studio, the name of the replay interface to be defined is the name of your Custom Server with an "I" prefix and a "Replay" suffix. For example, if your Custom Server is named abc, the Test Run interface is IabcReplay.

Running Some Methods in the AUT Context

If your Custom Server runs in the UFT (QTP) context, you can still run some code in the AUT context. To accomplish this, create assistant classes that extend CustomAssistantBase.

Table Verification

To support table verification, implement a class that extends VerificationServerBase.