Forum Discussion

Guido_P's avatar
Guido_P
Occasional Contributor
2 years ago
Solved

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

Hi all,

 

I recently migrated my Testcomplete 14 tests to 15 and am currently running Version: 15.49.6.7 x64.
We are using Testcomplete to regression test our desktop applications and have recently upgraded our desktop application to use Java 17.


The execution plan consists of several tests with the application called "Workbench". The way of working will most likely look familiar:

  • open the "Workbench" application (to get a clean sheet)
  • create or open a project
  • execute the test
    close the project that has just been tested
  • close the "Workbench" application
  • next test
  • open the "Workbench" application
  • create or open a project
  • execute the test
  • close the project
  • close the application 

Now, when I do a full run,let's say the execution plan has four tests to run, the following happens:
Test 1 executes, the application is closed by Testcomplete and Test 2 executes, the application is closed , test 3 and 4 run but after issuing the final close "Workbench" command (after executing test 4), Testcomplete will fail the test stating the "Workbench.exe" process crashed and test execution is interrupted.

However, in my opinion, the process didn't "crash" but was terminated by Testcomplete on account of the execution plan (which it did 3 times succesfully with the same nametest "CloseApplication". There are built in delays in that test to ensure the process has fully completed, but that doesn't seem to help.

 

Any ideas?

  • If you have closed the application via the menu option File -> Close, the applications closes but the process remains. Then ideally you should have a Sys.WaitProcess Method that checks the process, before continuing with the remaining tests

     

13 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    If you have closed the application via the menu option File -> Close, the applications closes but the process remains. Then ideally you should have a Sys.WaitProcess Method that checks the process, before continuing with the remaining tests

     

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    The crash error isn't necessarily a "crash".  It's that the application closed unexpectedly.  In other words, your "CloseApplication"; call attempted to close the application but the application closed for some other unexpected reason.

    My suspicion:  There's something in Test 4 that is actually causing the application to close and the "close" takes some time to complete so that, when you get to the final "Close", it is already in the process of closing... hence the unexpected close.

    So, I'd start with taking a close, indepth look at Test 4 and see what's going on at the end of it that might be causing this unexpected closure.   Run Test 4 stand alone and watch what is happening.

  • Guido_P's avatar
    Guido_P
    Occasional Contributor

    Hi Robert,

     

    thanks for taking the time to read my wall of text and replying. Unfortunately, I can't agree with test 4 being the issue. Not fully yet, anyway.

    When I run test 4 stand alone it will crash one time, but when I re-run it, it passes without even blinking an eye. Not done enough tries to give a percentage of fails but will do so soon.

    IF it crashes and burns it immediately happens after I see the project being closed and the shellWorkbenchwindow receives the Close operation from Testcomplete.
    The close project is a separate nametest and is the last thing to fully pass before the crash occurs according to the log.

     

    Below is an example:

     

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Could you post a screenshot or the code for your close application test?  I'd like to see how you're actually doing the call.

      Another thought that has come to mind, though, is that I THINK (but I could be wrong) that there is some sort of automatic setting that if an application is added as a Tested Application in the appropriate project component, that it automatically closes that application at the end of a test run.  So, I wonder if there may be conflicting closes happening.  You're calling your close routine which executes and completes but then TestComplete is trying to close the same application that you already started the Close process for and it registers it as a "Crash".

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        OK, yes, I was wrong.  There doesn't appear to be such a setting.

        However, question:  Your application... are you using it as a Tested Application in TestComplete?  If so, what do you have your "Run Mode" set to?

  • Guido_P's avatar
    Guido_P
    Occasional Contributor

    Here it is. The application is a Tested Application, so I could try and disable the close thing at the end to see if that helps.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Your application may be doing something while you close the application, which causes it to crash. Might be worth increasing the delay before closing.

  • Guido_P's avatar
    Guido_P
    Occasional Contributor

    Increasing timeouts is what I've been doing and is not helping in making things more stable unfortunately.

     

    In previous incarnations of this (and similar) workbench applications they were running on Java 11. When Testcomplete closed the applications the processes were not always immediately closed or a crash popup would occur. That's why the button click was added, to click away the crash pop up and continue the test.

     

    Since the application migrated to Java 17 those popups no longer occur (hence the click OK button is now obsolete) but the process still crashes (in the background).

    I now changed the properties of the close application nametest to continue on error and that makes the rest of the test being finalized in good fashion. However, the end result is still marked as a failure. Any ideas how to fix that? 

     

    On a side note, these popups and crashes only occur when using Testcomplete. When I do theses test manually things work fine.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    The close statement, is that calling a Java Close method or is it clicking on the X button to close the application?

  • Guido_P's avatar
    Guido_P
    Occasional Contributor

    Java Close. 

    I also tried: go to file menu, click close application.
    The application is terminated (on screen at least), but when it is restarted for the next test, I end up with a message stating that the application is running (or at least its processes) if I disabled the check for running processes.
    So, can (and will) try the hit "X" button but I think I need to have a check (and kill) for a running process before launching the application again. 

  • Guido_P's avatar
    Guido_P
    Occasional Contributor

    Just checked for clicking the "x" but that is also considered a Java Close as the Object has this alias: Aliases.javaw.ShellWorkbench.