Custom Test Types Interfaces

Test Type Example

'These members represent the main TestType object properties.
Public RemoteAgentCLSID As String ' Run Remote Agent Class ID
Public ScriptViewerCLSID As String ' ActiveX script viewer Class ID
Public TestingToolName As String ' Remote Agent name
Public ExecConfigCLSID As String ' Configuration Class ID
Public LastErrorMessage As String ' Most common error message
Public ResultViewerCLSID As String ' ActiveX result viewer Class ID

'
'*******************************************************************
Private Sub Class_Initialize()
'This sub-routine is run when the TestType is loaded.
'Note that at this time, none of the optional controls is
' supported, as their class ID strings are empty.
'Also note that the remote agent class ID is empty,
' as no such agent yet exists.
'This example does not support script templates,
' and has only one error type.

    ExecConfigCLSID = "" ' No configuration utility provided
    RemoteAgentCLSID = "[Class ID for the Run Remote Agent]"
    ScriptViewerCLSID = "[Class ID for ActiveX script viewer]"
    TestingToolName = "Script"
    LastErrorMessage = "" ' Testing issues
    ResultViewerCLSID = "" ' No result viewer ActiveX provided
    LoadPicture ""
End Sub

Public Sub Init(mytd As Variant)
    ' You may need a TDConnection to use OTA functions in your application.
    ' If you do, add a project reference to the OTA:
    ' In Projects > References, check the "OTA COM 8.0 Type Library."
    ' and declare a module-level variable: Private td As TDConnection
    Set td = mytd 'Get the td object to be used if needed
End Sub

Public Function CreateScriptTemplate(TestKey As Long, _
        ByRef LocalPath As String) As Long
    ' Create a batch file to emulate a test script for
    ' this example
    Dim myf As String
    LocalPath = "c:\temp"
    myf = "C:\temp\batch.bat"
    Open myf For Output As #1
    Print #1, "ping localhost" & vbCrLf & "pause" 'create script template
    Close #1
    CreateScriptTemplate = 1
End Function

Public Function GetBitmap(Status As Long) As Long
      GetBitmap = 0 'no bitmap
   End Function

Public Function CanCreateScriptTemplate() As Long

    CanCreateScriptTemplate = 1

End Function


© 1992 - 2012 Hewlett-Packard Development Company, L.P.