Thanks Marsha_R
Totally agree. the best practice is to close existing browser applications before i launch the tests and I have implemented it the very same way of writing an if condition to check if an browser exists and close it if it does. But sometimes if there is any browser warning then it could not Click on "Leave Page" and quit the browser.
So i have added conditional statements to check if those objects exists and Click on Leave Page in case they exists . But this is taking for ever. My sign in test almost took 2 minutes .
So as a solution for that I have thought of using Tested applications and opening the application in a new browser window.
My question now is : Is there a way to Force Close the IE browser regardless of browser warnings and pop ups??