Forum Discussion
Hi zoey,
If the process to be closed has an event handler that requires user final interaction, this can indeed block (dialog "do you want to save your file", etc.).
In my opinion, the problem is more the method used.
Personally, I've created a dedicated method that applies the Close() command and tests for correct closure, several times (in order to send the Close() command back to potentially open child dialogs) and as a last resort ends with the Terminate() command to guarantee closure (with an ultimate test for correct closure).
For the exact reason of no closure of your process, it's more the process to be closed that contains it... Are there any logs to trace what happens when it receives the close message?
- zoey10 months agoOccasional Contributor
Hello ,
Thanks in advance for your replied , you mean close method doesn't work correctly when event handler that requires user final interaction ? , my test finished by exit an application (File->exit ) and when exit an application popup message appeared to ask if you want to save file or not as you said "process to be closed has an event handler that requires user final interaction",
my code here applied to exit without save the file then check the process if still stuck in background or not ,
when I looked to test logs in the bellow seems test printed the message "before check process " in the logs but not close the process maybe unexpected error happened but I don't know what's the error , so process still stuck in task manager and next test can't start if not close correctly .
so how can I fix this issue ?
Thanks .