Forum Discussion

dcfecker's avatar
dcfecker
Contributor
6 years ago

when closing My Application under test, TestComplete errors out with Application.exe process crashed

Code being executed:

 

CloseLE.Click(); // "X" to close LE
Aliases.Live_Earth.AreYouSureClose.Close.Click(); // Close confirmation
if(Aliases.Live_Earth.Exists && Aliases.Live_Earth.SaveForNextTime.Exists) {
   Aliases.Live_Earth.SaveForNextTime.Discard.Click();
}

 

"The Live Earth.exe process crashed" is being logged for line 3 of the above code. This didn't used to happen. I would be able to close, and then re-open the application under test without issue. What changed? Why Am I getting a "process crashed" message when I'm simply closing the Tested App to then re-open it?

  • If you close the application, then it no longer exists.  If it doesn't exist, then the object Aliases.Live_Earth is no longer a valid object.  SO, you can't call "Exists" property from a non-existant object.  

     

    A better way to check for existance is the following:

     

    CloseLE.Click(); // "X" to close LE
    Aliases.Live_Earth.AreYouSureClose.Close.Click(); // Close confirmation
    var liveEarthProcess = Aliases.WaitAliasChild('Live_Earth', 2000);
    if(liveEarthProcess.Exists && liveEarthProcess.WaitAliasChild('SaveForNextTime', 2000).Exists) {
       Aliases.Live_Earth.SaveForNextTime.Discard.Click();
    }
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    If you close the application, then it no longer exists.  If it doesn't exist, then the object Aliases.Live_Earth is no longer a valid object.  SO, you can't call "Exists" property from a non-existant object.  

     

    A better way to check for existance is the following:

     

    CloseLE.Click(); // "X" to close LE
    Aliases.Live_Earth.AreYouSureClose.Close.Click(); // Close confirmation
    var liveEarthProcess = Aliases.WaitAliasChild('Live_Earth', 2000);
    if(liveEarthProcess.Exists && liveEarthProcess.WaitAliasChild('SaveForNextTime', 2000).Exists) {
       Aliases.Live_Earth.SaveForNextTime.Discard.Click();
    }
    • dcfecker's avatar
      dcfecker
      Contributor

      That was close. I ended up making the assignment before the close confirmation and that seems to work. 

       

      Thanks!

       

          CloseLE.Click(); // "X" to close LE
          var liveEarthProcess = Aliases.WaitAliasChild('Live_Earth', 2000);
          Aliases.Live_Earth.AreYouSureClose.Close.Click(); // Close confirmation
      
      • dcfecker's avatar
        dcfecker
        Contributor

        Maybe it is actually Crashing...

         

        The second time I ran it I got the same message: The Live Earth.exe process crashed.

         

        But I'm getting no other indication that the executable is crashing, it's shutting down like normal and when I start it up again the things I changed are saved.

  • What happens if you do the exact same test steps manually?  Does the .exe still crash?