dcfecker
6 years agoContributor
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(); }