-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
Meta -
OS:
Windows 7 Enterprise
Selenium Version:
2.53.1, IDE
Browser:
Chrome, IE
Browser Version:
Chrome: 55.0.2883.87
IE: 11
Expected Behavior -
It should clear cookies and redirect to login page.
Actual Behavior -
It is clearing the cookies but when navigating to login page the cookies are restoring back.
The cookies are restoring even if i do page refresh after deleting cookies.
Steps to reproduce -
I am using Machine Specs (MSpec), ReSharper (test runner) and Selenium.
My idea is to run Selenium web driver instance only once during the whole test cycle which means web driver starts at the beginning of first test and stops at the end of last test. During each test I want to clear out my cookies so that I can come back to my login screen before performing next test. So, I have a common method in MSpec that will be called before end of each test and in that method I am calling IWebDriver.Manage().Cookies.DeleteAllCookies(); and next navigating to login screen but it is not working.
My login token will be stored in cookies after login so i want to clear/delete cookies.
The did the debug at IWebDriver.Manage().Cookies.DeleteAllCookies(); after that I checked the cookies in browser it shows 0 cookies, but when I am navigating to login screen again in browser it is showing cookies.
In order to double check, after executing IWebDriver.Manage().Cookies.DeleteAllCookies(); I did manual refresh with out navigating to login page still the cookies are coming back.