Wednesday, 30 August 2017

Code Example - Delete Cookies

package com.practiceCode;

import org.testng.annotations.Test;

/**
 * @Blog Name : Selenium Code Example
 * @author Deepak Gupta
 * @Created Date 30-08-2017
 *
 */

public class DeleteCookies extends SuperTestNG {

@Test
public void testDeleteCookies() {
try {
driver.get("https://www.google.co.in/");
System.out.println("Before cookies delete: " + driver.manage().getCookies());
driver.manage().deleteAllCookies(); //
System.out.println("After cookies delete: " + driver.manage().getCookies());
} catch (Exception e) {
e.printStackTrace();
}
}
}

No comments:

Post a Comment

Code Example - File Download By Robot Class In Firefox Browser

Exported from Notepad++ package com . practiceCode ; import java . awt . AWTException ; import java . awt . Robot ; import j...