I've written the following code for attaching my recovery scenario with script during run time. It is as follows:
Dim App
Set App = CreateObject("QuickTest.Application")
App.Test.Settings.Recovery.Enabled = True
App.Test.Settings.Recovery.SetActivationMode "OnEveryStep"
App.Test.Settings.Recovery.Add "C:\QTP\Recovery\Navigation.qrs", "Navigation", 1
App.Test.Settings.Recovery.Item(1).Enabled = True
Recovery.Activate
App.Test.Save
The recovery scenario is not invoked.
Is the code correct? Am I missing something?
EDIT: The recovery scenario gets added to the script (i.e., can be seen in File->Settings->Recovery
) but it is not being invoked. But if we run it for the second time, it gets invoked.
Thanks for your help in advance.