Skip to content

Delete all cookies is not deleting cookies permanently from browser. #3324

@udayky372

Description

@udayky372

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions