public void CloseWindowAfterScenario() { var closeWindow = Convert.ToBoolean(ConfigurationManager.AppSettings["CloseWindow"]); if (closeWindow) { if (IEInstance != null) { IEInstance.GoTo(SiteUrl + "/logoff.aspx"); IEInstance.Close(); } } }