Forum Discussion

murugans1011's avatar
murugans1011
Regular Contributor
11 years ago

Runtime Errors

Is it possible to detect runtime errors in appln with vbscript?
  • Hi,



    Actually, reported first chance exception is a flag to you that there was an exception within your tested application but this exception was handled by the application itself. The only thing that you may do here is to consult with your developers whether this exception was expected one or not. If the exception was expected (this may be application's architecture by design), then you may forget about it. If the exception was not expected, that developers may think about how to avoid it (change application's code, logic, etc.).

    http://blogs.msdn.com/b/davidklinems/archive/2005/07/12/438061.aspx

    http://support.microsoft.com/kb/105675/en-us



14 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Hugo,



    Thank you for the link - I definitely will read it later today.



    > [...] I would put my money on the debugger actually generating the exception.

    My understanding is that it is OS that detects illegal operation (access to the protected memory, in our case) and throws the exception to give a chance for the software to handle this gracefully. If this first chance exception is not handled, then OS throws second chance exception that usually terminates the application.

    I think that practically the same is said on the article that I referenced: http://support.microsoft.com/kb/105675/en-us

    A quote from there:

    ==========

    [...] if the application is being debugged, the debugger sees all exceptions before the program does. This is the distinction between the first and second chance exception: the debugger gets the first chance to see the exception (hence the name). If the debugger allows the program execution to continue and does not handle the exception, the program will see the exception as usual. If the program does not handle the exception, the debugger gets a second chance to see the exception. In this latter case, the program normally would crash if the debugger were not present.

    ==========



    Actually, assumption that the tested application did not crash and the quoted excerpt was the reason of why I wrote that the reported first chance exception may be ignored if it is expected by the tested application's design.



    Do you think that I am wrong somewhere? (I am not exceptions guru and would like to get some knowledge in this area, that is why I am wondering about your opinion...)
  • murugans1011's avatar
    murugans1011
    Regular Contributor
    Could please provide me how to detect error(see attached screenshot) with debug services...when i run tested app using debug services there is no such "divide by zero error" detected
  • murugans1011's avatar
    murugans1011
    Regular Contributor
    hi Alex,
    the debug services application provided under testcomplete samples,whn i run script if the "exception","test all" commands are clicked ,thn its being detected by testcomplete debugger(divide by zero) error and posted in testlog...how it can be used in my application