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

Originally posted by zwergnaeschen on July 17, 2025

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.

Originally posted by rraghvani on July 17, 2025

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

Originally posted by JDR2500 on July 21, 2025

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.