IMP : On driver.close() / driver.quit(), will these methods delete browser cookies ! ? - Need help

158 views
Skip to first unread message

Vinothkumar Velusamy

unread,
Apr 9, 2014, 8:17:50 PM4/9/14
to seleniu...@googlegroups.com
Hi Everyone,

Let driver will be any driver (safari/FF/Chrome/IE) , on using driver.close() / driver.quit(), will these delete the cookies. 

my requirement is to test as follows ;
1) user should login in with his user credentials with xyz website.
2) first time, it will ask for some security questions..
3) It will redirects to user home page.

Please note :
-->if the same user login again in the same browser without closing it, then it should take to step 3 instead. (since cookies remains same and it will not got to login page)
-->if user closes the browser and reopens it again , then he has to go for step 1 , then application takes to step 3 and not to step 2.

I am following an approach:

1) write first method which will open the browser and do from step 1 to 3 and close the browser.
2) write second method, which will do step 1 and 3 verification.

is there any way to perform the above approach in single step. my intension is to delete the cookies and then use same browser to test it without closing.

Please free to ping me in case needed. Thank you everyone in advance for this help.
my Skype id : vinoth.velus

Oscar Rieken

unread,
Apr 9, 2014, 9:40:25 PM4/9/14
to seleniu...@googlegroups.com
ever time webdriver opens a browser its a new profile. for what you want to do you will need to manage the profile


--
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/97c79011-8e01-43e2-9ab2-b746b28418bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

murali

unread,
Apr 14, 2014, 10:03:16 AM4/14/14
to seleniu...@googlegroups.com
Hi Vinothkumar Velusamy ,

WebDriver starts new browser each and every time.. so you need to repeat all the steps... i hope following suggestions will help:

1. start the profile and save all the cookies. whenever you need to go through all steps just delete all the cookies by driver.Manage().Cookies.DeleteAllCookies();

else

2. you have to manage cookies. just check below link



Thanks,
Murali
Reply all
Reply to author
Forward
0 new messages