Forum Discussion

Colin_McCrae's avatar
Colin_McCrae
Community Hero
10 years ago

Object Spy locks on application crash?

Currently working with an application which is c# .NET at it's core. And it spawns Delphi modules.

 

I'm trying to write a crash handler for it. (It does crash during tests sometimes .... in various different ways)

 

I've hit a problem. When a sub-process crashes, the .NET part of the application throws a crash message. This first part is no problem. I map all the parts of the dialog box it generates. Capture all the error text and click the button to close it. (OK being the only button)

 

This is where the problem starts.

 

When this Dialog closes, it throws a second message box. Once this one is on screen, TestComplete becomes totally unresponsive and only comes back to life once this Dialog is closed (manually). Using CTRL+SHIFT+A I did manage to capture one button. But as soon as it captures that, it was completely unresponsive again.

 

As you can imagine, that makes doing anything with this Dialog box kind of tricky.

 

This is the name locator I did manage to capture:

 

Sys["Process"]("WerFault")["Dialog"]("<MY_APPLICATION>")["Window"]("DirectUIHWND", "", 1)["Window"]("CtrlNotifySink", "", 10)["Window"]("Button", "Close the program", 1)

 

(For the "Close the program" button)

 

Any ideas? If an application crash is going to cause the test kit to stop working, I may have a problem .....

 

(It is not a child object of the application I'm working on ...)

6 Replies

  • Don't you just hate it when c#.NET apps spawn Delphi modules?

     

    Since you already gather a lot of info about the crash, try terminating the application at a point after you get your info, but before it locks up TestComplete/TestExecute.

     

    Tell those programmers to fix it! Fix it! Fix it!

     

     

     

    • Colin_McCrae's avatar
      Colin_McCrae
      Community Hero

      Don't think the problem lies with my application.

       

      The whole of TestComplete freezes up (other applications are OK) once this dialog box appears.

       

      I found this:

       

      https://community.smartbear.com/t5/Functional-Web-Testing/Preventing-crashes-when-running-testcomplete/m-p/73315#M13503

       

      My error dialog is coming from Werfault.exe. So it would appear that TestComplete still has problems with this. I'm going to see if I can find a way round it by killing everything process and service level after taking the information from the initial dialog. (The one prior to the WerFault one .... which is fine)

       

      TC 11.20. Win 7 Pro 64 bit.

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        Killing everything at process level does the trick.

         

        And is fine. As the application is about to stop/die at that point anyway. All the information of any worth is in the first Dialog and is captured and logged. The one causing the problems is just the "Has encountered a problem and needs to close" window. No useful info in it so no loss if I never see it ....