Micro Focus QTP (UFT) Forums
Load Add-in at execution time - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Load Add-in at execution time (/Thread-Load-Add-in-at-execution-time)



Load Add-in at execution time - driverdash - 08-11-2015

I am executing multiple QTP scripts via a Windows Script batch file and Windows Scheduler. One of the multiple scripts listed in the batch file use the SAP Add-in, while the others do not. Is there anybody out here that knows how to select and/or remove Add-ins from the Add-in Manager at run-time? Here's the Script code:

Code:
Const strEnvironment = "QA"
Const strBatchSetLoc = "[location]"

'---------------------------------------------------------------------------------------------

Dim qtApp, qtTest
Set qtApp = CreateObject("QuickTest.Application")
'Set ObjCmd = createobject("wscript.shell")
qtApp.Launch
qtApp.Visible = True

qtApp.Open (strBatchSetLoc&strEnvironment&"\[test name 1]"), True
Set qtTest = qtApp.Test
qtTest.Run         
qtTest.Close

qtApp.Open (strBatchSetLoc&strEnvironment&"\[test name 2]"), True
Set qtTest = qtApp.Test
qtTest.Run         
qtTest.Close

...

'---------------------------------------------------------------------------------------------

qtApp.quit
Set qtTest = Nothing
Set qtApp = Nothing

Is there a better method than this? Any help is appreciated.