Ask a Question

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

SOLVED
dcfecker
Contributor

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?

5 REPLIES 5
Marsha_R
Champion Level 3

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

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();
}

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

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

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.

Hi,

 

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

Robert's suggestion is more correct, because, obviously, you will get a reference to the currently running process if you do this before closing it.

Also you may try to give your tested application some time to close by putting a, say, 5seconds delay after the .Close() command and before the block that checks if the application was closed.

Finally, you may consider the Report Generator utility provided with TestComplete (https://support.smartbear.com/testcomplete/docs/testing-with/advanced/tracing-critical-errors/report...) to check if your tested application indeed crashes in some way and contact Support via the https://support.smartbear.com/message/?prod=TestComplete form providing them with your findings.

 

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
cancel
Showing results for 
Search instead for 
Did you mean: