CustomServerBase Class
| Mercury.QTP.CustomServer Namespace : CustomServerBase Class |
The base class for the .NET custom support server class.
Object Model

Remarks
Your custom server extends CustomServerBase and implements your replay interface.
public class MyAppSrv:
CustomServerBase,
IMyAppSrvReplay
CustomServerBase exports utility methods. These utility methods are divided into the General and Remote access categories.
General utilities include recording a method in OpenText Functional Testing, accessing the settings, and writing to the test results.
Remote access services are accessible only to custom servers running in the testing tool context. They are used to access properties and methods on the .NET control and create remote objects that run in the AUT context.
A custom server must implement the following methods in the derived class:
- InitEventListener
- ReleaseEventListener
Syntax
'Declaration<System.Runtime.InteropServices.ComVisibleAttribute(False)> Public MustInherit Class CustomServerBase Inherits System.MarshalByRefObject Implements IRecord
[System.Runtime.InteropServices.ComVisible(false)] public abstract class CustomServerBase : System.MarshalByRefObject, IRecord
Inheritance Hierarchy
System.Object
System.MarshalByRefObject
Mercury.QTP.CustomServer.CustomServerBase
Public Properties
| Name | Description | |
|---|---|---|
![]() | SourceControl | Returns the source control object. |
![]() | WndHandle | Returns the Control's window handle. |
Protected Properties
| Name | Description | |
|---|---|---|
![]() | RemoteAccess | Exposes the unsafe remote interface definitions. |
Public Methods
| Name | Description | |
|---|---|---|
![]() | Disconnect | This method supports the product infrastructure. Do not override and do not call directly in your code. |
![]() | DragAndDrop | Simulates Mouse Drag and Drop operation. |
![]() | GetSettingsValue | Returns the Parameter value from the Settings sub-element of this control in the SwfConfig.xml configuration file. |
![]() | GetSettingsXML | Returns the Settings sub-element of this control in the SwfConfig.xml configuration file. |
![]() | GetWndMessageFilter | See IRecord.GetWndMessageFilter |
![]() | Init | This method supports the product infrastructure. Do not override and do not call in your code. |
![]() | InitEventListener | This method is called once to start listening for events. See IRecord.InitEventListener |
![]() | InitializeLifetimeService | Overridden. Prevents your Custom Server from timing out. Do not change or override this implementation. |
![]() | KeyDown | Simulates Key Down operation. |
![]() | KeyUp | Simulates Key Up operation. |
![]() | MouseClick | Simulates Mouse Click operation. |
![]() | MouseDblClick | Simulates Mouse Double Click operation. The method gets Control clients coordinates. |
![]() | MouseDown | Simulates Mouse Down operation. |
![]() | MouseMove | Simulates Mouse Move operation. |
![]() | MouseUp | Simulates Mouse Up operation. |
![]() | OnMessage | See IRecord.OnMessage |
![]() | PrepareForReplay | Overloaded. Prepares the Control for a replay action. |
![]() | PressKey | Simulates Press Key operation. |
![]() | PressNKeys | Simulates pressing a key the specified number of times. |
![]() | RecordFunction | Writes a test object method call to the test script. |
![]() | ReleaseEventListener | This method is called at the end of the recording session to stop listening for events. See IRecord.ReleaseEventListener |
![]() | ReplayReportStep | Writes an event to the test report. |
![]() | ReplayThrowError | Overloaded. Throws an exception based on the specified error and sets the step status to EventStatus.EVENTSTATUS_FAIL. |
![]() | SendKeys | Sends a string to the control in a new thread. |
Protected Methods
| Name | Description | |
|---|---|---|
![]() | AddHandler | Overloaded. Adds an Event handler in the AUT context. If other handlers exist for the event, the handler added with AddHandler is called first. |
![]() | AddRemoteEventListener | Creates an EventListener instance in the AUT context. |
![]() | ControlGetProperty | Returns a property of a control that is not thread-safe. |
![]() | ControlInvokeMethod | Invokes a method of a control that is not thread-safe. |
![]() | ControlSetProperty | Sets a property of a control that is not thread-safe. |
![]() | CreateRemoteObject | Creates an Assistant instance of the specified type in the AUT context. |
![]() | Finalize | Distructor. |
![]() | GetTypeNameFromHandle | Returns the type name of the control in the window. |
![]() | InvokeAssistant | Invokes a method of a CustomAssistantBase class in the control's thread. |
![]() | SendString | Deprecated. Use SendKeys |
![]() | ShowError | Displays the .NET warning icon. |
![]() | TestObjectInvokeMethod | Invokes a method that is exposed by the test object's IDispatch interface. |





