Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 2 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
add comment

Your Answer

 
discard

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.