I'm trying to programmatically remap the location of Recovery Scenarios across all our QTP tests. Using a modified version of what is provided in the QTP Automation Object Model manual, but even when I run the example code exactly as provided I get the same error. I have the code in an external .vbs file running from command prompt.
The qtTestRecovery.Add line errors out with a "Permission Denied" runtime error. I've tried with running both command prompt and QTP as administrator with no luck. Also double checked the DCOM settings and those are good. Any other ideas what permission it is missing?
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTestRecovery 'As QuickTest.Recovery ' Declare a Recovery object variable
Dim intIndex ' Declare an index variable
' Open QuickTest and prepare objects variables
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.New ' Open a new test
qtApp.Visible = True ' Make the QuickTest application visible
Set qtTestRecovery = qtApp.Test.Settings.Recovery ' Return the Recovery object for the current test
If qtTestRecovery.Count > 0 Then ' If there are any default scenarios specified for the test
qtTestRecovery.RemoveAll ' Remove them
' Add recovery scenarios
qtTestRecovery.Add "C:\Recovery.qrs", "ErrMessage", 1 ' Add the "ErrMessage" scenario as the first scenario