This is a migrated thread and some comments may be shown as answers.

DeleteCookies isn't actually deleting cookies

11 Answers 220 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael Paterson
Top achievements
Rank 1
Michael Paterson asked on 09 Jul 2011, 06:53 PM
My authentication utilizes Identity Foundation cookies.  So in order to test multiple users on the same data-driven test, I need to clear the cookies before having the user login again.

In a coded step I have the following:

ActiveBrowser.ClearCache(BrowserCacheType.Cookies);
ActiveBrowser.Cookies.DeleteCookie("mydomain.com");

However, this doesn't seem to be deleting the cookies.
I added a manual step to ensure that the cookies are gone but they are still there.

If I can't get this to work then the next best thing is to close the browser and open a new one.


Thoughts?

11 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 11 Jul 2011, 06:31 PM
Hi Michael,

Thank you for evaluating Test Studio. The URL needs to be fully listed, like this:

ActiveBrowser.Cookies.DeleteCookie("http://www.mydomain.com/")

Also be sure to list subpages individually, like this:


You can insert a codeless Clear Cookies step from the "Add" menu, however it will clear ALL cookies from the active browser, unconditionally. Here's what that looks like if you convert it to code:

// Clear Browser Cookies
ActiveBrowser.ClearCache(ArtOfTest.WebAii.Core.BrowserCacheType.Cookies);


Regards,
Anthony
the Telerik team
Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

Have you looked at the new Online User Guide for Telerik Test Studio?
0
Michael Paterson
Top achievements
Rank 1
answered on 11 Jul 2011, 06:41 PM
That's interesting.  Your documentation in the code (ie. intellisense) says differently unless I'm misunderstanding:

See attached picture.

I updated the code as you specified.  However, the cookies still are not being deleted.
0
Anthony
Telerik team
answered on 11 Jul 2011, 11:18 PM
Hello Michael,

I used your original code in a test that logs into twitter.com. It worked with and without the "http://".

Does adding the "Clear Cookies" step from the "Add" menu work?

Please see this thread for a similar discussion. Is your issue browser-specific? Is the site you are testing public for us to reproduce the issue locally? If not, does a public site exhibit similar behavior?

Greetings,
Anthony
the Telerik team
Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

Have you looked at the new Online User Guide for Telerik Test Studio?
0
Michael Paterson
Top achievements
Rank 1
answered on 13 Jul 2011, 08:32 PM
Hi Anthony,

Adding the Clear Cookies step doesn't seem to work either.  I had a GoToMeeting today with Dan and showed him the issue.  
I'd prefer not to simply use Clear Cookies because we have some specific requirements around cookies but at this point I'm willing to try anything.

I've tried a whole slew of things and none of them seem to work.  I'm going to upgrade to the latest release tomorrow or Friday and will try it out again.

The link you provided appears to be broken.  Our site is not public.  I may be able to get some test credentials for you if you can provide an email address or something that I can send them to.

Thanks,
Mike
0
Anthony
Telerik team
answered on 13 Jul 2011, 10:16 PM
Hello Michael Paterson,

I accidentally gave you an internal link; here's the link to the public thread I previously mentioned.

I agree the Clear Cookies step is not ideal for your application, but I'd like to confirm it works for another public site, like Gmail for example. That way we can isolate that it is your app's cookies specifically that Test Studio is having difficulty with.

Let me know once you've upgraded and if the issue persists. I will send you an email to the address on file for you to reply with credentials for us to test with.

Regards,
Anthony
the Telerik team
Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

Have you looked at the new Online User Guide for Telerik Test Studio?
0
Anthony
Telerik team
answered on 28 Jul 2011, 09:48 PM
Hi Michael Paterson,

Please direct all communication through the ticketing system and not direct email.

I did some research on Identity Foundation cookies. It seems they are harder to delete than normal. See here for more information. I also found a way to make the browser delete the cookie by setting it to expired.

Regards,
Anthony
the Telerik team
Check out the Test Studio roadmap to find out more about the new performance testing functionality coming in our R2 2011 release this September!

Have you looked at the new Online User Guide for Telerik Test Studio?
0
John
Top achievements
Rank 1
answered on 20 Mar 2013, 08:07 PM
I am having what appears to be the exact same issue.  I've traced the source of the problem down to we are correctly using the secure flag on our cookies. Any cookie with the secure flag set is not being deleted.

http://en.wikipedia.org/wiki/HTTP_cookie#Secure_and_HttpOnly
0
Cody
Telerik team
answered on 25 Mar 2013, 09:55 PM
Hi John,

I apologize for the delay getting back to you on this. Which browser (and version) have you noticed this on? Different browser may behave differently. I noticed something similar on another public website (only some cookies are getting deleted) using IE 9 but I didn't narrow it down to which type of cookies were/were not getting deleted. I appreciate the additional information. I have filed a bug on this here.

Regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
John
Top achievements
Rank 1
answered on 26 Mar 2013, 02:19 PM
I do not know for sure if the bug exists in all browser extensions, but it absolutely does in chrome. (And I believe it does in FF).  Also it is worth noting that it does not delete cookies with the secure flag set even if you use delete cookie method that takes a specific cookie. (You can enumerate all the cookies just fine, but even every method of deleting seems to fail.)
0
Cody
Telerik team
answered on 26 Mar 2013, 05:51 PM
Hello John,

Thank you for letting me know which browser you were using. I added that information to the bug report. I do not have a way to work around this problem at this time. All we can do is wait for my development team to investigate what's going on here.

Kind regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Girish
Top achievements
Rank 1
answered on 02 Dec 2015, 04:53 AM
is this issue resolved ?  am facing similar issue.. 
Tags
General Discussions
Asked by
Michael Paterson
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Michael Paterson
Top achievements
Rank 1
John
Top achievements
Rank 1
Cody
Telerik team
Girish
Top achievements
Rank 1
Share this question
or