| || |
Is it possible to detect plugins?
As part of the test initialisation in my framework, I wish to be able to detect which plugins are currently being used by QTP, specifically I need to check that the Terminal Emulator plugin is being used. Does anyone have any example code that can do this?
Re: Is it possible to detect plugins?
The answer is yes .... just figured it out, sharing in case anyone else wants to know:
<font class="small">Code:</font><hr /><pre>
Dim intAddInCount, n
Dim blnMatched : blnMatched = false
'get an instance of QTP
set objQTPApplication = createobject("Quicktest.Application")
'get the count of add ins
intAddInCount = objQTPApplication.AddIns.Count
If intAddInCount > 0 Then
For n = 1 to (intAddInCount)
'Print objQTPApplication.AddIns.Item(n).Name 'Will print out the add-in name if you wish to debug it
If objQTPApplication.AddIns.Item(n).Name = strAddIn then
blnMatched = true
IsAddInInstalled = blnMatched
msgbox IsAddInInstalled("Terminal Emulators")