Hi Nisha, some of the most commonly used Selenium Webdriver commands to manage cookies are:
-
Get Cookies: Used to return the list of all Cookies stored in web browser.
manage().getCookies();
-
Get Cookies by name: Returns the specific cookie according to its name.
manage().getCookieNamed(arg0);
-
Add Cookies: It is used to create and add the cookie.
manage().addCookie(arg0)
-
Delete Cookies: Used to delete a specific cookie.
manage().deleteCookie(arg0);
-
Delete Cookies by name: This is used to delete a cookie according to its name.
manage().deleteCookieNamed(arg0);
-
Delete All Cookies: This statement is used to delete all cookies.
manage().deleteAllCookies();