Implementing Test Record for a Custom Control Using a .NET DLL

Recording a business component or test on a control means listening to the activity of that control, translating that activity into test object method calls, and writing the method calls to the test. Listening to the activities on the control is done by listening to control events, by hooking Windows messages, or both.

Note: If you plan to create GUI tests using keyword-driven testing, and not by recording steps on an application, you do not need to implement Test Record.

Write the code for Test Record by implementing the methods in the code segment created by the wizard based on the IRecord interface (provided with the UFT One .NET Add-in Extensibility SDK). Your Test Record implementation does not inherit from the existing test object to which the custom control is mapped. It replaces the existing object's Test Record implementation entirely. Therefore, if you need any of the existing object's functionality, code it explicitly.

Before reading this section, make sure you are familiar with Create Custom Servers.

This section describes:

For more information on the interfaces, classes, enumerations, and methods in this section, see the API Reference.

Implementing the IRecord Interface

To implement the IRecord interface, override the callback methods described below and add the details of your implementation in your event handlers or message handler.

The examples provided below for each callback method are written in C#.