Showing posts with label Cookies. Show all posts
Showing posts with label Cookies. Show all posts

Sunday, May 18, 2014

How to delete cookies.

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Cookies {
    public static void main(String[] args) {
        WebDriver driver = new FirefoxDriver();
        driver.get("https://www.google.co.in/");
        System.out.println("cookies before delete: "+driver.manage().getCookies());
        driver.manage().deleteAllCookies(); //
        System.out.println("cookies after delete: "+driver.manage().getCookies());
    }
}