Deleting Cookies in a Remote IE Webdriver

486 views
Skip to first unread message

Brian Rock

unread,
Jun 6, 2013, 8:29:11 PM6/6/13
to seleniu...@googlegroups.com
Has anyone had any luck deleting cookies in a remote IE webdriver?  All attempts are failing for me right now. 

Here's my code building the Remote IE Driver 

case REMOTE_INTERNETEXPLORER_10:

            try {

                DesiredCapabilities dc = DesiredCapabilities.internetExplorer();

                dc.setVersion("10");

                dc.setCapability(CapabilityType.TAKES_SCREENSHOT, true);

                dc.setCapability(

                        CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION,

                        true);

                dc.setCapability("ignoreProtectedModeSetting", true);


                driver = new ScreenShotRemoteWebDriver(new URL(

                        "http://corpwebdrivergrid.amazon.com/wd/hub"), dc);


                logger.info("Remote Internet Explorer Initialized");

                userAgent = (String) ((JavascriptExecutor) driver)

                        .executeScript("return navigator.userAgent;");

                logger.info("User Agegnt:[" + userAgent + "]");


            } catch (MalformedURLException e) {

                e.printStackTrace();

            }

            break;


Thanks
Brian 

Arran

unread,
Jun 7, 2013, 5:00:44 AM6/7/13
to seleniu...@googlegroups.com
How is it failing in particular?

Brian Rock

unread,
Jun 7, 2013, 11:15:16 AM6/7/13
to seleniu...@googlegroups.com
It's not deleting the cookies on the Remote Driver.  

I've tried deletion all cookies driver.manage().deleteAllCookies().  and individual cookies driver.manage().deleteNamedCookie("Some Cookie Name"). 




--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/22c14b4d-54fa-4a50-b25c-e3a5f17e3fd2%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mark Collin

unread,
Jun 7, 2013, 11:46:55 AM6/7/13
to seleniu...@googlegroups.com
Can you see the cookies in the JavaScript Console?

Point a browser at the website and then once you have the required cookies open a JavaScript console and type "document.cookie"

Brian Rock

unread,
Jun 7, 2013, 2:14:46 PM6/7/13
to seleniu...@googlegroups.com
Yes, I can see the cookies.  I can even see the cookies through the API using driver.manage().getCookies(). 


Divya Maheshwari

unread,
Jun 10, 2013, 5:29:49 AM6/10/13
to seleniu...@googlegroups.com
Hi,

In my script i used getDriver().manage().deleteAllCookies(); and it works fine for me even you can delete specific cookie by giving its name in bracket. it should work.

Thanks

David

unread,
Jun 10, 2013, 3:08:21 PM6/10/13
to seleniu...@googlegroups.com
By the way, the posted code does not invoke cookie deletion at all. I'm assuming it's just to show how you've set up the IE session with WebDriver.

And did you delete the cookies under the correct domain? They aren't visible for deletion when you're not on the cookie's domain, even for deleteAllCookies(). I also recommend page refresh or navigate to different page after cookie deletion before verifying cookie(s) deleted just in case.

Vikas Gupta

unread,
Jul 12, 2015, 11:17:18 PM7/12/15
to seleniu...@googlegroups.com
I have to delete a particular cookie and i have used driver.manage().deleteNamedCookie("Some Cookie Name"). But its not working for IE10. You had faced similar issues earlier, can you please help how you solved this issue ?
Reply all
Reply to author
Forward
0 new messages