Unable to add cookie | Selenium Forum
M
Posted on 26/03/2016
On the web site, there is a pop which comes up on first login. It stores a cookie. I have tried to add a cookie to bypass that.its not working( tried in chrome and FF). The code I have tried is( before login) :
Cookie temp = new Cookie("name","value")'
driver.manage().addCookie(temp);
Please help!!

M
Replied on 29/03/2016

add this in statement in the end and give me the result.

[quote:38tp7fvj]Set<Cookie> cookiesList = driver.manage().getCookies();
for(Cookie getcookies :cookiesList) {
System.out.println(getcookies );
}
[/quote:38tp7fvj]