Cleaning cookies every time new test is run in Internet Explorer

845 views
Skip to first unread message

John Kirr

unread,
Jan 25, 2012, 8:00:33 AM1/25/12
to Selenium Users
I'm using Selenium 2.17 with chibimagic's php webdriver bindings to
run tests with phpunit. Everything is fine with Firefox and co but I
have an issue with Internet Explorer retaining cookies from the
previous tests, such as logins, etc.

I tried doing something like $this->delete_all_cookies() and $this-
>driver->delete_all_cookies() before each test but that doesn't seem
to do anything.

I also tried setting desired capability such as:

$this->driver = WebDriver_Driver::InitAtHost("somehost.com" ,"4444",
"internet explorer",array('ENSURING_CLEAN_SESSION' => true));

This also doesn't have any effect on the cookies status.

Any help would be appreciated. Thanks!

Jayakumar C

unread,
Jan 25, 2012, 8:22:34 AM1/25/12
to seleniu...@googlegroups.com
Try Se-Server startup option -ensureCleanSession.

-ensureCleanSession: If the browser does not have user profiles,
    make sure every new session has no artifacts from previous
    sessions.  For example, enabling this option will cause all user
    cookies to be archived before launching IE, and restored after IE
    is closed.



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.




--
Jayakumar

John Kirr

unread,
Jan 25, 2012, 9:36:25 AM1/25/12
to Selenium Users
Thanks, I tried both having it as an option for the Grid hub -
ensureCleanSession and also as an option for browser configuration for
webdriver servers -browser browserName="internet
explorer",platform=WINDOWS,ensureCleanSession=true

None of these made any difference. It still retains cookies for tests
that are run afterwards. Although I noticed that if I manually open IE
there are no cookies as expected.

On Jan 25, 1:22 pm, Jayakumar C <jayakumaree...@gmail.com> wrote:
> Try Se-Server startup option -ensureCleanSession.
>
> -ensureCleanSession: If the browser does not have user profiles,
>     make sure every new session has no artifacts from previous
>     sessions.  For example, enabling this option will cause all user
>     cookies to be archived before launching IE, and restored after IE
>     is closed.
>

vishnu

unread,
Aug 5, 2013, 8:33:59 AM8/5/13
to seleniu...@googlegroups.com
There seems to intermittent issue in clearing cookies in IE,  we too have observed it several times. So clearing cookies/cache using command line option of instead of Webdriver is a good solution and is working fine for us.

You can find more on this at :
http://automationoverflow.blogspot.in/2013/07/clean-session-in-internet-explorer.html

Hope this feature will be included in Webdriver future releases.

Thanks,
Vishnu

Jim Evans

unread,
Aug 5, 2013, 9:41:35 AM8/5/13
to seleniu...@googlegroups.com
As of version 2.33.0.9 of IEDriverServer.exe, you can set the "ie.ensureCleanSession" capability to true for the IE driver, and it will perform this action for you. See the CHANGELOG[1] for full details. You can get a prebuilt binary containing this change in the Selenium Git repository[2], or you can wait for 2.34.0.0, which will provide the public release of this feature.

--Jim

[1] http://selenium.googlecode.com/git/cpp/IEDriverServer/CHANGELOG
[2] http://selenium.googlecode.com/git/cpp/prebuilt/Win32/Release/

Krishnan Mahadevan

unread,
Aug 5, 2013, 10:02:36 AM8/5/13
to Selenium Users
Jim,
Any tentative dates for 2.34.0 release ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

Jim Evans

unread,
Aug 5, 2013, 10:15:09 AM8/5/13
to seleniu...@googlegroups.com
When it's ready.

Oh, sorry, you want more than that? No, I can't give any dates on such a thing. It might be today, it might be weeks from now. That's the problem with a volunteer project like ours, someone has to step up and push a release through, and no one has picked that up yet.

I apologize for seeming brusque about this, but this project is about as open as any you'll find, and the answer is the same for all releases. There is no set calendar by which releases happen. The IRC channel (#selenium on Freenode) almost always has at least one or two committers online, and questions are answered there in a reasonably timely manner, usually nearly real-time. Many committers don't monitor the mailing lists because of the low signal-to-noise ratio, but are far more accessible there.

--Jim

Krishnan Mahadevan

unread,
Aug 5, 2013, 10:26:18 PM8/5/13
to seleniu...@googlegroups.com
Jim,

After being on this user list for around a year, I think I do understand  a little bit about open source projects :) [ the release date thingy is something new though ] 

I was only curious to know if you were aware of any dates. 

Like everyone else in the world I too shalt wait patiently until then. 


For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
Reply all
Reply to author
Forward
0 new messages