TestedApp.Close doesn't close the application
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2011
02:01 AM
10-10-2011
02:01 AM
TestedApp.Close doesn't close the application
Hi,
when trying to close the AUT using the following method http://smartbear.com/support/viewarticle/12380/ th application doesn't close.
anyone know why?
Thanks
when trying to close the AUT using the following method http://smartbear.com/support/viewarticle/12380/ th application doesn't close.
anyone know why?
Thanks
15 REPLIES 15
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2011
02:09 AM
10-10-2011
02:09 AM
I tried the following:
Worked just fine. How are you implementing? Could you post the code you're using? Are you getting any errors?
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
function meh()
{
var MyApp = TestedApps.NOTEPAD.Run()
Delay(1000)
MyApp.Close()
}
Worked just fine. How are you implementing? Could you post the code you're using? Are you getting any errors?
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2011
02:26 AM
10-10-2011
02:26 AM
Hi Robert,
that doesn't work.any other ideas?
thanks
that doesn't work.any other ideas?
thanks
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2011
02:29 AM
10-10-2011
02:29 AM
As I said, that worked fine for me.. I'm running TestComplete 8.60 and there are no problems.
So, the question is still, how have you implemented this concept? Please post your code.. include any information such as the kind of application you're testing (web, desktop, etc) and any error messages you're getting.
See, I say it works, you say it doesn't, somewhere there's something wrong. If you can post your code with that information, we can figure out, from there, what's going wrong.
I've also done the following:
This closes all three... however, the last line DOES generate a warning saying it couldn't find one instance...but that is expected since I closed one of the three individually.
So... the methodology from the help article is working using the simple "NOTEPAD" example as given... so, the problem is probably within the application you're using or how you're implementing it.
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
So, the question is still, how have you implemented this concept? Please post your code.. include any information such as the kind of application you're testing (web, desktop, etc) and any error messages you're getting.
See, I say it works, you say it doesn't, somewhere there's something wrong. If you can post your code with that information, we can figure out, from there, what's going wrong.
I've also done the following:
function meh()
{
var MyApp = TestedApps.NOTEPAD.Run() //Notepad has a count value of 3
Delay(1000)
MyApp.Close()
TestedApps.NOTEPAD.Close();
}
This closes all three... however, the last line DOES generate a warning saying it couldn't find one instance...but that is expected since I closed one of the three individually.
So... the methodology from the help article is working using the simple "NOTEPAD" example as given... so, the problem is probably within the application you're using or how you're implementing it.
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2011
02:42 AM
10-10-2011
02:42 AM
Sure Got you,
the AUT is a desktop application
here is the code:
main unit:
//USEUNIT InvokeAUT
//USEUNIT CloseAUT
function Main()
{
InvokeAUT["Invoke"]()
CloseAUT["Close"]()
}
InvokeAUT unit:
//USEUNIT CloseAUT
function InvokeAUT()
{
if(Aliases["AUTDesktopMainWindow"]["Exists"])
CloseAUT["CloseAUT"]()
//Loading the AUT
TestedApps["AUTDesktop"]["Run"]()
//Check that the AUT loaded properly
if(Aliases["AUTDesktopMainWindow"]["Exists"])
{
Log["Message"]("AUT was loaded properly")
return
}
else
Log["Warning"]("AUT wasn't load properly,script aborted")
}
function CloseAUT()
{
TestedApps["AUTDesktop"]["Close"]()
//Check that the AUTclosed properly
if(!Aliases["AUTDesktopMainWindow"]["Exists"])
Log["Message"]("AUT was closed properly")
else
{
Log["Warning"]("AUT wasn't closed properly,script aborted")
return
}
}
the AUT is a desktop application
here is the code:
main unit:
//USEUNIT InvokeAUT
//USEUNIT CloseAUT
function Main()
{
InvokeAUT["Invoke"]()
CloseAUT["Close"]()
}
InvokeAUT unit:
//USEUNIT CloseAUT
function InvokeAUT()
{
if(Aliases["AUTDesktopMainWindow"]["Exists"])
CloseAUT["CloseAUT"]()
//Loading the AUT
TestedApps["AUTDesktop"]["Run"]()
//Check that the AUT loaded properly
if(Aliases["AUTDesktopMainWindow"]["Exists"])
{
Log["Message"]("AUT was loaded properly")
return
}
else
Log["Warning"]("AUT wasn't load properly,script aborted")
}
function CloseAUT()
{
TestedApps["AUTDesktop"]["Close"]()
//Check that the AUTclosed properly
if(!Aliases["AUTDesktopMainWindow"]["Exists"])
Log["Message"]("AUT was closed properly")
else
{
Log["Warning"]("AUT wasn't closed properly,script aborted")
return
}
}
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2011
02:57 AM
10-10-2011
02:57 AM
I replaced the AUT stuff with the windows calculator... works fine.
Is your application running when you run the invoke? Is the process present in memory? Do you have more than one copy present in memory? Are you getting error messages?
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
Is your application running when you run the invoke? Is the process present in memory? Do you have more than one copy present in memory? Are you getting error messages?
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2011
03:04 AM
10-10-2011
03:04 AM
answers to your questions:
Yes, although it takes around 10 seconds for it to invoke
Yes
No
I'm getting warning message in the Test Log file:
Type Message Time Priority Has Picture Link
The application "C:\Program Files (x86)\xxx\AUT\AUTDesktop.exe" got a command to close, but it is still running, though the default timeout has expired. 16:02:03 Higher
Thanks
Yes, although it takes around 10 seconds for it to invoke
Yes
No
I'm getting warning message in the Test Log file:
Type Message Time Priority Has Picture Link
The application "C:\Program Files (x86)\xxx\AUT\AUTDesktop.exe" got a command to close, but it is still running, though the default timeout has expired. 16:02:03 Higher
Thanks
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2011
03:15 AM
10-10-2011
03:15 AM
Hi Robert,
it's not nice to say but when i restarted TC it seems to work fine.weird isn't it
can you think of something that can cause that?
thanks for the help 🙂 appreciate it
it's not nice to say but when i restarted TC it seems to work fine.weird isn't it
can you think of something that can cause that?
thanks for the help 🙂 appreciate it
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2011
03:16 AM
10-10-2011
03:16 AM
When you normally close your application, does it take a long time for it to actually complete the close process? Is there user interaction necessary on close?
The problem at this point seems to be related to how your application processes the close command or, even, what it's doing at start up. It could be that when you are trying to close it, you're not waiting long enough to let it complete the startup process. Try putting something like a Delay(60000) between the Invoke and Close to see if, after you wait a while, the close command works.
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
The problem at this point seems to be related to how your application processes the close command or, even, what it's doing at start up. It could be that when you are trying to close it, you're not waiting long enough to let it complete the startup process. Try putting something like a Delay(60000) between the Invoke and Close to see if, after you wait a while, the close command works.
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2012
06:35 AM
01-12-2012
06:35 AM
When I close my own tested application, it closes the program but the process is still running. I believe Test Complete holds a handle on it and thats why the process doesnt end.
I force quit my program from task manager and windows error reporting reports that there was an appcrash.
I believe that you guys are using hooks in Test Complete and that the library called tcuihook.dll could be the culprit.
Pretty problematic at my workplace.
I force quit my program from task manager and windows error reporting reports that there was an appcrash.
I believe that you guys are using hooks in Test Complete and that the library called tcuihook.dll could be the culprit.
Pretty problematic at my workplace.
