Forum Discussion
15 Replies
Sort By
- tristaanogreEsteemed ContributorI tried the following:
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? - OfervSuper ContributorHi Robert,
that doesn't work.any other ideas?
thanks - tristaanogreEsteemed ContributorAs 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:
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. - OfervSuper ContributorSure 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
}
} - tristaanogreEsteemed ContributorI 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? - OfervSuper Contributoranswers 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 - OfervSuper ContributorHi 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 - tristaanogreEsteemed ContributorWhen 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. - itvrdeichContributorWhen 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. - HKosovaSmartBear Alumni (Retired)Hi Ivan,
Our support engineers are working on your ticket regarding this issue. They will get back to you once they have found the root cause of the problem.
Related Content
- 11 months agosanket2799
- 11 months agolalit_singh
Recent Discussions
- 3 days agovladd1