Forum Discussion
Hi,
In general your approach is correct. You are correctly using .WaitBrowser() to check if the given browser process is running.
The case is that quite often I've seen that IE does not always closes its process and this causes TestComplete to stuck until IE process is closed. So in case of IE you may choose not to check whether IE is running or not, but terminate all running instances of IE and start it anew.
Relevant discussion along with the code can be found here: https://community.smartbear.com/t5/TestComplete-Functional-Web/Leave-site-pop-up-is-getting-displayed-if-I-use-stop-test-item/m-p/184687/highlight/true#M34437
So instead of using the GUI it's best to write underlying code to achieve proper closure of browser instances? The behaviour is very intermittent when using the GUI functions. Sometimes it will open a browser window, sometimes it won't.