fabioandrec / selenium-vba

Automatically exported from code.google.com/p/selenium-vba
0 stars 0 forks source link

Clear Fireforx Cookies #120

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Operating system : windows 7
.Net Framework version :
Office Version : 2010
SeleniumWrapper version : 2.8.0

What is your issue ?

Hi,

Thanks in advance,

Please help me to clear Firefox cookies

I tried by sending keys but it's not working OR is there any way to clear 
cookies

    selenium.SendKeys keys.Control & keys.Shift & keys.Delete

tried above keys to open "Clear Recent History" box. It opens but excel not 
responding for some time and throwing error

Thanks

Original issue reported on code.google.com by sunilm...@gmail.com on 28 Nov 2014 at 11:54

GoogleCodeExporter commented 9 years ago
Have you tried the deleteAllVisibleCookies command?

Original comment by florentbr on 28 Nov 2014 at 3:06

GoogleCodeExporter commented 9 years ago
I know, but how to use this means all cookies get clear. Please help me to 
provide full syntax of this

Original comment by sunilm...@gmail.com on 28 Nov 2014 at 6:12

GoogleCodeExporter commented 9 years ago
Dim driver As New SeleniumWrapper.WebDriver
driver.start "firefox", "http://news.yahoo.com"
driver.open "/science"
driver.deleteAllVisibleCookies
driver.stop

Original comment by florentbr on 28 Nov 2014 at 6:41

GoogleCodeExporter commented 9 years ago
Hi

I tried by driver.deleteAllVisibleCookies but this is not working

Thanks

Original comment by sunilm...@gmail.com on 29 Nov 2014 at 3:42

GoogleCodeExporter commented 9 years ago
I couldn't reproduce your issue:

Dim driver As New SeleniumWrapper.WebDriver
driver.start "firefox", "http://news.yahoo.com"
driver.open "/science"
driver.assertCookie ""

Could you provide a failing example?

Original comment by florentbr on 1 Dec 2014 at 9:51

GoogleCodeExporter commented 9 years ago
Hi, Thanks for your response

I want to Remove all cookies from Firefox but by below syntax it's not working

driver.deleteAllVisibleCookies

It's not giving any error but even not clearing / removing all cookies

Thanks

Original comment by sunilm...@gmail.com on 1 Dec 2014 at 10:43

GoogleCodeExporter commented 9 years ago
How do you check there is still some cookies left?
Can you provide a failing scenario? 

Original comment by florentbr on 1 Dec 2014 at 11:09

GoogleCodeExporter commented 9 years ago
After passing above syntax (by debugging), I have checked in Option -> Privacy 
-> Show Cookies -> Cookies. it showing all cookies there

Original comment by sunilm...@gmail.com on 1 Dec 2014 at 11:21

GoogleCodeExporter commented 9 years ago
Just to be clear, do you understand that every time the scrip is executed, a 
new clean Firefox session is created without any history/cookie
and that it is a different configuration from the Firefox you would launch 
manually?

Original comment by florentbr on 1 Dec 2014 at 12:35

GoogleCodeExporter commented 9 years ago
I'm launching it at starting after that my loop start to navigate URL's, before 
ending loop i need to clear cookies but it's not working by above syntax

Original comment by sunilm...@gmail.com on 1 Dec 2014 at 1:08

GoogleCodeExporter commented 9 years ago
The reason could be that deleteAllVisibleCookies only deletes the cookies from 
the current page domain and you may have some created in an frame related to 
another domain.
There's no command in the Selenium 1 API to delete all cookies for all domains, 
but there's one in the Selenium 2 API.
Unfortunately it's not implement in the current release of Selenium VBA.
It will be available in the next release: 1.0.24

Original comment by florentbr on 2 Dec 2014 at 10:53