protractor icon indicating copy to clipboard operation
protractor copied to clipboard

browser.manage().DeleteAllCookies() Not Deleting Cookies in Firefox

Open stevenmccord opened this issue 10 years ago • 6 comments

Bug report

  • Node Version: v4.4.3
  • Protractor Version: 3.2.2
  • Browser(s): Firefox
  • Operating System and Version Linux

I have tried browser.manage().deleteAllCookies() as well as browser.driver.manage().deleteAllCookies() but nothing seems to actually clear the cookies. I was hoping that it would remove all cookies in the browser, but it doesn't seem to do that.

I have looked on other forums and they say that this should work, so wondering if there is something else I am missing on this. Thanks!

stevenmccord avatar Apr 28 '16 01:04 stevenmccord

As a note, I also just upgrade to version 3.3 and I still get the same error.

stevenmccord avatar Apr 28 '16 01:04 stevenmccord

Looking at the selenium-webdriver api, deleteAllCookies should work as described. The delete all cookies returns a promise, are you waiting for the promise to return?

@return {!promise.Promise<void>} A promise that will be
resolved when all cookies have been deleted.

Do you know which version of protractor this worked in?

cnishina avatar Apr 28 '16 19:04 cnishina

Yeah I believe I am waiting to resolve. I am not sure when this was actually working though, but I was on gitter IM and someone said they had it working in chrome at some point, but not real details. Here is my code:

    this.Before("@clearSession", function (scenario, callback) {
        browser.deleteAllCookies().then(function(){
            callback();
        });
    });

stevenmccord avatar Apr 28 '16 19:04 stevenmccord

@cnishina I see that you needed more information on this one, is there anything else I can provide for you? Thanks!

stevenmccord avatar May 05 '16 02:05 stevenmccord

Hi,

I have got the same issue here. It works well in chrome, but it does not work in Firefox.

thanhltx avatar Mar 23 '17 05:03 thanhltx

It even doesn't work in IE and Edge. Any thoughts?

smajazayeri avatar Aug 12 '17 00:08 smajazayeri