i'm using qtp 10 with a class-based framework using object repository. there is an application login method that gets called in many of our tests. part of the login involves confirming a particular prompt has displayed and then clicking the OK button on the prompt. 90% of the time the method runs fine. however, sometimes it fails. when i review the log file of what has happened, it finds the prompt, it finds the button, it clicks the button, but the prompt remains open. if i manually click the button, the prompt will close, so it's not a problem where the application has stopped working. instead, it seems like the QTP interface with the application has gotten messed up (though if i manually click the OK button, the automation is able to drive things from there). i'm at a complete loss on this one. any ideas what might cause this?
already have that. the code first checks if the dialog exists. if yes, then the code checks if the button exists. if yes, then the code clicks the button. even without the explicit check for the button, if the button really weren't there then QTP would normally generate an error. however, QTP sees the button and thinks it is clicking on it.
Try to check if the prompt is visible(always on Top) prior to performing the operation. Also check , if the prompt exist even after clicking the OK button using a loop. If the Prompt exist, the code would recheck the same and click on the button.