There is a good QTP recovery scenario called "Any error":

'Any error' recovery scenario

But still QTP is not firing recovery scenario in several cases (as I've found here):

  • Script Errors
  • Object Not in Object Repository (OR)
  • Modal dialog blocking execution
  • Associated Library is not found
  • Activate Recovery Scenario setting is not configured properly

If you are going to execute a set of tests automatically (VB script that executes one test after another), as soon as you come to an error which can not be seen (and also handled) by QTP recovery scenario all the test will not be executed from this time, testing process would stuck at this point.

Is there any way to avoid this problem (need automation solution!), how to reset QTP test execution without recovery scenario (to close/kill qtp process, open next test in qtp)?

Till now: I see solution as setting timeout for test execution (e.g. Test1 - 1:30) if timeout is expired and test is not completed the test should be closed. But there is no good-looking timeout realization as I see in VBScript.

1 Answer 1


To check the way recovery scenario failing to handle the cases described above I have added the following code to QTP test script (errors tested Object Not in Object Repository (OR) & Script Errors):

'       to check recovery after fail that is not handled by QTP's recovery scenario - Object Not in Object Repository (OR)
JavaDialog("Does not exist").JavaButton("Save").Click

'       to check recovery after fail that is not handled by QTP's recovery scenario - Script Errors
a = 2/0

When I run the test from QTP window it failes as expected (No recovery scenario is fired):

qtp fails as expected

But when the test is started by vbscrip (for more information check How can I run a QTP test from the command line?) all these errors are skipped (test execution goes on as well as recovery scenario are not fired!):

errors are skipped by QTP

But still all test should be limited by execution time, so here is the question about test execution time limitation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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