public void DeleteAllCookies() { var MRes = new ManualResetEventSlim(true); MRes.Reset(); Exception exception = null; Task.Run(async() => { try { await cookies.DeleteAllCookies().ConfigureAwait(false); } catch (Exception ex) { exception = ex; } MRes.Set(); } ); MRes.Wait(); if (exception != null) { throw exception; } }
public static IWebDriver ClearCookies(this IWebDriver webDriver) { Contract.Assert(webDriver != null, "The web driver cannot be null."); ICookieJar cookieJar = webDriver.Manage().Cookies; if (cookieJar != null) { cookieJar.DeleteAllCookies(); } return(webDriver); }
public void DeleteAllCookies() { _cookieJar.DeleteAllCookies(); }