public static void Browse(string username, Action <SouthwindBrowser> action) { var selenium = new ChromeDriver(); var browser = new SouthwindBrowser(selenium); try { browser.Login(username, username); action(browser); } catch (UnhandledAlertException) { selenium.SwitchTo().Alert(); } finally { selenium.Close(); } }
public static void Browse(string username, Action<SouthwindBrowser> action) { var selenium = new ChromeDriver(); var browser = new SouthwindBrowser(selenium); try { browser.Login(username, username); action(browser); } catch (UnhandledAlertException) { selenium.SwitchTo().Alert(); } finally { selenium.Close(); } }