|
这是帮助里面的例子:
'************************************************************************************************************************
'Description:
'
'This example replaces the Java Add-in with the Oracle Add-in in the
'associated add-ins list of the specified test.
'
'Assumptions:
'
'There is no unsaved test currently open in QuickTest.
'For more information, see the example for the Test.SaveAs method.
'************************************************************************************************************************
Dim qtApp ' As QuickTest.Application ' Declare the Application object variable
Directory = InputBox("Enter the path of the test you want to convert.")
Call ConvertTest(Directory)
Private Function ConvertTest(TestPath)
' Create the Application object
Set qtApp = CreateObject("QuickTest.Application")
' Open the test.
Call qtApp.Open(TestPath)
' Retrieve the list of the test's associated add-ins
Addins = qtApp.Test.GetAssociatedAddins()
' If Java appears in the retrieved list, replace it with Oracle.
For i = 0 To UBound(Addins)
If Addins(i) = "Java" Then
Addins(i) = "Oracle"
End If
Next
' Apply the new associated add-ins list to the test.
If Not qtApp.Test.SetAssociatedAddins(Addins, ErrorDesc) Then
MsgBox "Unable to modify the associated add-ins for this test: " _
& Chr(13) & TestPath _
& Chr(13) & ErrorDesc
Exit Function
End If
' If the change is successful, save the test.
Call qtApp.Test.Save
End Function
SetAssociatedAddins方法的参数应该是数组 |
|