public class CookieDemo {
WebDriver d;
Set<Cookie> s;
@Test
public void testExecution() {
d= new FirefoxDriver();
d.get("https://www.flipkart.com");
//getting all the cookies and retrieving
s=d.manage().getCookies();
for (Cookie cookie : s) {
System.out.println("cookie name :"+cookie.getName());
System.out.println("cookie values:"+cookie.getValue());
}
d.manage().deleteAllCookies();
}
}
WebDriver d;
Set<Cookie> s;
@Test
public void testExecution() {
d= new FirefoxDriver();
d.get("https://www.flipkart.com");
//getting all the cookies and retrieving
s=d.manage().getCookies();
for (Cookie cookie : s) {
System.out.println("cookie name :"+cookie.getName());
System.out.println("cookie values:"+cookie.getValue());
}
d.manage().deleteAllCookies();
}
}
No comments:
Post a Comment