Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium WebDriver manager().getCookies() returns 0 always

Tags:

Selenium WebDriver manager().getCookies() in InternetExplorerDriver always returns 0 elements! P.S. version 2.32.0.0

like image 498
Serhii Bohutskyi Avatar asked Apr 11 '13 15:04

Serhii Bohutskyi


People also ask

What is returned by driver () Manage ()?

driver. manage() is a method that returns instance of options interface, now the options interface has method window() that returns instance of window interface, this window interface has method maximize() which maximizes the window.

What is the return type of Webdriver?

It return type is string. It will returns browser windlw handle from focused browser. It is used to handle multiple windows.


2 Answers

If the cookies are HTTPOnly you can't read them from Javascript/Selenium

like image 159
Eitan Peer Avatar answered Oct 25 '22 17:10

Eitan Peer


Set<Cookie> allcookies = driver.manage().getCookies();
System.out.println(allcookies);
like image 25
sidharth shukla Avatar answered Oct 25 '22 17:10

sidharth shukla