CustomServerBase Class
The base class for the .NET custom support server class.
Object Model
CustomServerBase Class
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 UFT, accessing the settings, and writing to the test results.

Remote access services are accessible only to custom servers running in the UFT 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
 NameDescription
Public PropertySourceControlReturns the source control object.  
Public PropertyWndHandleReturns the Control's window handle.  
Top
Protected Properties
 NameDescription
Protected PropertyRemoteAccessExposes the unsafe remote interface definitions.  
Top
Public Methods
 NameDescription
Public MethodDisconnectThis method supports the UFT infrastructure. Do not override and do not call directly in your code.  
Public MethodDragAndDropSimulates Mouse Drag and Drop operation.  
Public MethodGetSettingsValueReturns the Parameter value from the Settings sub-element of this control in the SwfConfig.xml configuration file.  
Public MethodGetSettingsXMLReturns the Settings sub-element of this control in the SwfConfig.xml configuration file.  
Public MethodGetWndMessageFilterSee IRecord.GetWndMessageFilter  
Public MethodInitThis method supports the UFT infrastructure. Do not override and do not call in your code.  
Public MethodInitEventListenerThis method is called once to start listening for events. See IRecord.InitEventListener  
Public MethodInitializeLifetimeServiceOverridden. Prevents your Custom Server from timing out. Do not change or override this implementation.  
Public MethodKeyDownSimulates Key Down operation.  
Public MethodKeyUpSimulates Key Up operation.  
Public MethodMouseClickSimulates Mouse Click operation.  
Public MethodMouseDblClickSimulates Mouse Double Click operation. The method gets Control clients coordinates.  
Public MethodMouseDownSimulates Mouse Down operation.  
Public MethodMouseMoveSimulates Mouse Move operation.  
Public MethodMouseUpSimulates Mouse Up operation.  
Public MethodOnMessageSee IRecord.OnMessage  
Public MethodPrepareForReplayOverloaded. Prepares the Control for a replay action.  
Public MethodPressKeySimulates Press Key operation.  
Public MethodPressNKeysSimulates pressing a key the specified number of times.  
Public MethodRecordFunctionWrites a test object method call to the test script.  
Public MethodReleaseEventListenerThis method is called at the end of the recording session to stop listening for events. See IRecord.ReleaseEventListener  
Public MethodReplayReportStepWrites an event to the test report.  
Public MethodReplayThrowErrorOverloaded. Throws an exception based on the specified error and sets the step status to EventStatus.EVENTSTATUS_FAIL.  
Public MethodSendKeysSends a string to the control in a new thread.  
Top
Protected Methods
 NameDescription
Protected MethodAddHandlerOverloaded. Adds an Event handler in the AUT context. If other handlers exist for the event, the handler added with AddHandler is called first.  
Protected MethodAddRemoteEventListenerCreates an EventListener instance in the AUT context.  
Protected MethodControlGetPropertyReturns a property of a control that is not thread-safe.  
Protected MethodControlInvokeMethodInvokes a method of a control that is not thread-safe.  
Protected MethodControlSetPropertySets a property of a control that is not thread-safe.  
Protected MethodCreateRemoteObjectCreates an Assistant instance of the specified type in the AUT context.  
Protected MethodFinalizeDistructor.  
Protected MethodGetTypeNameFromHandleReturns the type name of the control in the window.  
Protected MethodInvokeAssistantInvokes a method of a CustomAssistantBase class in the control's thread.  
Protected MethodSendStringDeprecated. Use SendKeys  
Protected MethodShowErrorDisplays the .NET warning icon.  
Protected MethodTestObjectInvokeMethodInvokes a method that is exposed by the test object's IDispatch interface.  
Top