I have a QTP script that interacts with a webpage. Occasionally, this webpage will pop-up dialogs that interfere with the rest of the test, and need to dismissed with a simple “OK” before I can continue running the test.
Recovery Scenarios are supposed to take care of this exact situation, but try as I might, QTP will never recognize the pop-up. The recovery scenario is set to trigger upon seeing a dialog with “Window title: Message from webpage”. I used the object spy so I know that this is the correct identification.
Attached is the dialog box that the webpage occasionally displays. Very simple dialog, so why won’t QTP recognize it?

Turns out, my Recovery Scenario was built correctly, but the problem I had was that QTP didn’t know when to activate the Recovery Scenarios.
Go to
File > Settings > Recovery, highlight the recovery scenario you want to have activate, then changeActivate recovery scenariostoOn every step.By default, the recovery scenarios are only activated when QTP throws an error, not when your web page throws an error.
Lastly, having the recovery scenario check every step will probably degrade performance.