Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.

share|improve this question
up vote 3 down vote accepted

Tom: This is expected behavior. You cannot dynamically load Recovery Scenarios and use them at runtime. Once it is associated though (manually or programmatically), the next time you run the script, it will be fired.

share|improve this answer
Thanks for the information – Tom Jun 27 '12 at 5:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.