How to check (and close) processes in a loop?
- 9 years ago
The following works for me using Excel as an example with Keyword tests. In the If Object dialog box, I just typed in the process (Sys.Process("Excel")) I wanted to check. I used a Go Label to make the process 'loop'.
- 9 years ago
Hi,
> some active processing
If those processes were started as Tested Applications by TestComplete, then CloseAll method (https://support.smartbear.com/viewarticle/68083/) might help.
Otherwise, the pseudocode is like this:
repeat
search for any instance of the process (i.e. ignoring its index)
if the process is found
call Close method for it
loop until the process exists and timeout was not exceeded
wait a bit ( .Delay(500) )
if timeout expired
call Terminate for the process
end of loop
end of if
until the process is found