How to Terminate Two or more instance of Application
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2018
02:51 AM
06-14-2018
02:51 AM
How to Terminate Two or more instance of Application
I have teste my wpf application using testcomplete. if already two instance of application are opened means how to i terminate that all application and i need to continue sequence of other cases to be run..
Note: i already tried TestedApps.<<app>>.Terminate();(when 2 instance of tested application are in open) but it vain.
Kindly advise me.
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2018
05:26 AM
06-14-2018
05:26 AM
If your application process name in Windows is myApp, then try the following:
function closeApplicationInstances(){ var currentProcess = Sys.WaitProcess('myApp', 2000); while (currentProcess.Exists){ currentProcess.Terminate() currentProcess = Sys.WaitProcess('myApp', 2000); } }
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
06-14-2018
09:05 AM
06-14-2018
09:05 AM
I wouldn't bother checking for 2 instances. At the top of your code, before you start the actual test, use @tristaanogre's code and close everything, then open your one instance for testing.
