Re: Clearing Cookies/cache using Selenium IDE:solution

12,904 views
Skip to first unread message

Franco DeAmicis

unread,
Jun 2, 2009, 9:29:17 AM6/2/09
to selenium-users...@googlegroups.com


{font:style=font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;}The eraseCookie command didn't work for me.&nbsp; I think this command expects a cookie to be a .txt file.&nbsp; Firefox cookies are stored in .sqlite files. \\ &nbsp; \\ Solution: \\ &nbsp; \\ Firefox has an addon called imacros. \\ &nbsp; \\ I created a macro to clear cache and cookies and added this macro to my bookmarks menu.&nbsp; I access this bookmark using keystrokes whenever I need to clear cookies. \\ Its not the coolest solution, but it works. \\ &nbsp; \\ &nbsp; \\ This is the script \\ <tr> \\ &nbsp; <td>open</td> \\ &nbsp; <td>[http://www.guide2batteries.com/?debug=true&amp;traffictype=content&amp;referrer=adwordsca</td|http://www.guide2batteries.com/?debug=true&amp;traffictype=content&amp;referrer=adwordsca%3c/td]> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>storeHtmlSource</td> \\ &nbsp; <td>sourcey</td> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>storeEval</td> \\ &nbsp; <td>storedVars['sourcey'].match(/TYPE17/)</td> \\ &nbsp; <td>firsturl</td> \\ </tr> \\ <tr> \\ &nbsp; <td>echo</td> \\ &nbsp; <td>${firsturl}</td> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>altKeyDown</td> \\ &nbsp; <td></td> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>keyPress</td> \\ &nbsp; <td>keywords</td> \\ &nbsp; <td>\98</td> \\ </tr> \\ <tr> \\ &nbsp; <td>pause</td> \\ &nbsp; <td>200</td> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>keyPress</td> \\ &nbsp; <td>keywords</td> \\ &nbsp; <td>\103</td> \\ </tr> \\ <tr> \\ &nbsp; <td>pause</td> \\ &nbsp; <td>200</td> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>keyPress</td> \\ &nbsp; <td>keywords</td> \\ &nbsp; <td>\103</td> \\ </tr> \\ <tr> \\ &nbsp; <td>keyPress</td> \\ &nbsp; <td>keywords</td> \\ &nbsp; <td>\13</td> \\ </tr> \\ <!--open&nbsp; [http://www.guide2batteries.com?debug=true&referrer=msnca|http://www.guide2batteries.com/?debug=true&referrer=msnca]--> \\ <tr> \\ &nbsp; <td>pause</td> \\ &nbsp; <td>200</td> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>open</td> \\ &nbsp; <td>[http://www.guide2batteries.com/?debug=true&amp;referrer=msn-canada</td|http://www.guide2batteries.com/?debug=true&amp;referrer=msn-canada%3c/td]> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>storeHtmlSource</td> \\ &nbsp; <td>sourcey2</td> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>storeEval</td> \\ &nbsp; <td>storedVars['sourcey2'].match(/TYPE11/)</td> \\ &nbsp; <td>firsturl2</td> \\ </tr> \\ <tr> \\ &nbsp; <td>echo</td> \\ &nbsp; <td>${firsturl2}</td> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>altKeyDown</td> \\ &nbsp; <td></td> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>keyPress</td> \\ &nbsp; <td>keywords</td> \\ &nbsp; <td>\98</td> \\ </tr> \\ <tr> \\ &nbsp; <td>keyPress</td> \\ &nbsp; <td>keywords</td> \\ &nbsp; <td>\103</td> \\ </tr> \\ <tr> \\ &nbsp; <td>keyPress</td> \\ &nbsp; <td>keywords</td> \\ &nbsp; <td>\103</td> \\ </tr> \\ <tr> \\ &nbsp; <td>altKeyDown</td> \\ &nbsp; <td></td> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>keyPress</td> \\ &nbsp; <td>keywords</td> \\ &nbsp; <td>\98</td> \\ </tr> \\ <tr> \\ &nbsp; <td>pause</td> \\ &nbsp; <td>200</td> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>keyPress</td> \\ &nbsp; <td>keywords</td> \\ &nbsp; <td>\103</td> \\ </tr> \\ <tr> \\ &nbsp; <td>pause</td> \\ &nbsp; <td>200</td> \\ &nbsp; <td></td> \\ </tr> \\ <tr> \\ &nbsp; <td>keyPress</td> \\ &nbsp; <td>keywords</td> \\ &nbsp; <td>\103</td> \\ </tr> \\ <tr> \\ &nbsp; <td>keyPress</td> \\ &nbsp; <td>keywords</td> \\ &nbsp; <td>\13</td> \\ </tr> \\ \\ {font}

Jerry Qian

unread,
Jun 2, 2009, 11:34:01 PM6/2/09
to selenium-users...@googlegroups.com
Have you tried command *deleteAllVisibleCookies*?
*deleteAllVisibleCookies()*Calls deleteCookie with recurse=true on all cookies visible to the current page. As noted on the documentation for deleteCookie, recurse=true can be much slower than simply deleting the cookies using a known domain/path.thanks,Jerry

Franco DeAmicis

unread,
Jun 3, 2009, 10:46:43 PM6/3/09
to selenium-users...@googlegroups.com
I tried deleteAllVisibleCookies.&nbsp; It didn't work for me.

David

unread,
Dec 4, 2012, 3:25:33 PM12/4/12
to seleniu...@googlegroups.com, selenium-users...@googlegroups.com, clear...@openqa.org
Perhaps if it doesn't work and you need it to work, this is where you might want to start considering using Selenium RC instead (or even WebDriver). Because it supposedly works in RC.

On Monday, December 3, 2012 12:03:05 PM UTC-8, praveen tendulkar wrote:
This doesn't work, it's a pain during testing.  
Reply all
Reply to author
Forward
0 new messages