Mine is automation suite which runs on IE browser. I have a function to terminate my browser for which I have used the below code
// public void terminateBrowser(string browsername) { try { Process[] pname = Process.GetProcessesByName("iexplore"); do { Host.Local.KillBrowser(browsername); Delay.Milliseconds(5000); pname = Process.GetProcessesByName("iexplore"); }while(pname.Length!=0); } catch(Exception e) { Logger.Instance.ErrorLog("Problem in executing terminateBrowser method because of " + e.ToString()); } }But the real problem i am facing is that at some random point during the execution of above method I get an error message "A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available."
Is there anyway to get rid of this issue? Help would be really appreciated.
Thanks