Forum Discussion

zwergnaeschen's avatar
zwergnaeschen
New Contributor
1 year ago

Process "crashed" and test fails when closing the application in test

Hi all,

We use TestComplete 15 to perform regression testing on our Delphi desktop application. We have a simple test:

  • open the application
  • short wait follows
  • close the application

Testcomplete will fail the test stating the "TestApp.exe" process crashed and test execution is interrupted.

Closing the application via X or through the 'Main Menu - Exit' results in the same error. The Sys.WaitProcess method also didn't help. We have also attempted to close it using the .Close() method.
Maybe I'm placing the Sys.WaitProcess method in the wrong spot. I would be very grateful for a code snippet (JavaScript) and any help.

thx.

2 Replies

  • JDR2500's avatar
    JDR2500
    Frequent Contributor

    Maybe your application hasn't finished loading when you attempt to close it?  Can you add another Wait method to confirm the application has finished loading?  For instance, we use a WaitWindow to detect that our start window has opened.  Other options might be a WaitProperty to verify the application window is enabled, or WaitProperty for a toolbar button to become enabled.

    It seems like a timing issue could be the culprit.  Just because WaitProcess determines the EXE is running doesn't mean the app is ready for interaction via automation or the user interface.

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    Have a look at the sample code shown here https://support.smartbear.com/testcomplete/docs/testing-with/tested-apps/closing.html 

    If you manually close your application, does it close without crashing?

    What version of TestComplete are you using?

    TestComplete includes the DbgServices plugin that lets you run tested applications in the Debug mode, see https://support.smartbear.com/testcomplete/docs/testing-with/advanced/tracing-critical-errors/about.html