public static string Close() { string retVal = ""; if (Chrome.Instance != null) { if (Chrome.Instance.CD != null) { try { try { Chrome.Instance.CD.Close(); } catch { } Chrome.Instance.CD.Quit(); Chrome.Instance.CD = null; } catch { } } Chrome.Instance = null; } return(retVal); }
public static void SetChromeInstance(bool fullScreen = false, bool headless = true, bool appMode = false, string appUrl = "") { if (Chrome.Instance == null || Chrome.Instance.CD == null) { Chrome.Instance = new SeleniumChrome(fullScreen: fullScreen, headless: headless, appMode: appMode, appUrl: appUrl); } }