예제 #1
0
        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;
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
 public void DeleteAllCookies()
 {
     _cookieJar.DeleteAllCookies();
 }