Thursday, November 20, 2008

QTP Script 20 - How to get the associated Addins for a particular test?

Write the below code in a notepad and save it with a .vbs extension and run it. When it will prompt for the input enter full path of the test for which you want to see the associated Addins.

Dim qtApp

f_path = InputBox("Enter the path of the test you want to convert.")
asso_add(f_path)

Private Function asso_add(TestPath)
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Open(TestPath)

' Retrieve the list of the test's associated add-ins, GetAssociatedAddins can be used only when QTP is open.

Addins = qtApp.Test.GetAssociatedAddins()

For i = 0 To UBound(Addins)
msgbox Addins(i)
Next

qtApp.Test.Save
qtApp.Quit

End Function