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); }
public static void AddCookies(this IWebDriver driver, List <Cookie> cookies) { foreach (var cookie in cookies) { driver.AddCookie(cookie); } }
public static void AddCookie(this IWebDriver driver, string key, string value) { driver.AddCookie(new Cookie(key, value)); }