I am trying to obtain the Cookies from the whole domain of a site but I can't seem to get it. Here is my code:
Set<Cookie> cookies = driver.manage().getCookies();
for (Cookie cookie : cookies) {
System.out.println(cookie);
}
This does what I want, however, I have a cookie that has another path value, and this snippet is not returning the correct cookie, any ideas?
Note: This works flawlessly on Chrome and Firefox, the browser in question is IE.
As far as my understanding and knowledge Internet explorer when opened with selenium maintain cookie and cache from earlier activities. At the time of initiating you can clean the instance.
capabilities = DesiredCapabilities.InternetExplorer();
capabilities.SetCapability("ie.ensureCleanSession", true);
ie.ensureCleanSession
When set to true, this capability clears the cache, cookies, history, and saved form data. When using this capability, be aware that this clears the cache for all running instances of Internet Explorer, including those started manually.
Please do tell me if this information is helpful
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With