Example #1
0
        public void AddCookie_WithValidCookieKeyValue_Successfully()
        {
            driver.Navigate().GoToUrl("https://www.google.com/");
            var cookiesBefore = driver.GetAllCookies();

            driver.AddCookie("test", "test");
            var cookiesAfter = driver.GetAllCookies();

            cookiesBefore.Count.AreLessThan(cookiesAfter.Count);
        }
Example #2
0
 public static void AddCookies(this IWebDriver driver, List <Cookie> cookies)
 {
     foreach (var cookie in cookies)
     {
         driver.AddCookie(cookie);
     }
 }
Example #3
0
 public static void AddCookie(this IWebDriver driver, string key, string value)
 {
     driver.AddCookie(new Cookie(key, value));
 }