Forum Discussion
tristaanogre
8 years agoEsteemed Contributor
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);
}
}- Marsha_R8 years ago
Champion Level 3
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.