Lets say there is a defect in a program execution in any language like java or c#, we have exception handling mechanism through which we can programmatically know that there is an error and in case we want to make a log of it we can store it in a txt or xls file.
In QTP, if i’m executing ten scripts and two scripts have failed and i want to make a log of the failed files in xls file, then how do i go about it? because it seems there is no mechanism programmatically through which i can detect that an error has occurred and a entry in the log accordingly. how do i approach this? ( by the way, i do not want to know about recovery scenario, because i’m not interested in handling the error but i’m interested in only detecting the error and making a note of it)
Thank you in advance
QTP scripts are based on VBScript, the equivalent of exceptions in VBScript is
On Errorwhich is described here (among other places).However I don’t see why you need this, if a test fails this fact gets logged in the run-report, can’t you look in the default reports to see which test failed?