I test a OAuth 2 Login page. It allows me to remember my login. This is done with a persistant cookie. Now I want to test if this cookie remains present after a browser restart which is its intent:
..load Page.. ..login which sets the cookie.. browser.Quit(); browser = new FirefoxDriver(); ..load Page.. Cookie is gone
Cookies of the test browser are enabled. I tested it with Firefox, Chrome and IE driver. The cookie is a persistent cookie and works perfectly with a manually started instance of one of the browsers.
What I do as a workaround:
..load Page.. ..login which sets the cookie.. var cookie = driver.Manage().Cookies.GetCookieNamed("cookie"); browser.Quit(); browser = new FirefoxDriver(); driver.Manage().Cookies.AddCookie(cookie); ..load Page..
Are those cookies deleted when Quitting the browser? Why does it not work as intended?