Cookies

This is a JavaScript wrapper for Cookies of Selenium .NET library.

Action Summary

Action Description
AddCookie Adds a cookie to the current page.
AllCookies Gets all cookies defined for the current page.
DeleteAllCookies Deletes the cookie with the specified name from the page.
DeleteCookie Deletes the specified cookie from the page.
DeleteCookieNamed Deletes the cookie with the specified name from the page.
GetCookieNamed Gets a cookie with the specified name.

Action Detail

AddCookie(cookie)

Adds a cookie to the current page.

Parameters:

Name Type Description
cookie Cookie Cookie object, e.g. {Name: "CookieName", Value: "CookieValue", Domain: "example.com", Path: "/", Expiry: "2018-12-28T13:15.00-05:00"}.

AllCookies()

Gets all cookies defined for the current page.

DeleteAllCookies()

Deletes the cookie with the specified name from the page.

DeleteCookie(cookie)

Deletes the specified cookie from the page.

Parameters:

Name Type Description
cookie Cookie Cookie object, e.g. {Name: "CookieName", Value: "CookieValue", Domain: "example.com", Path: "/", Expiry: "2018-12-28T13:15.00-05:00"}.

DeleteCookieNamed(name)

Deletes the cookie with the specified name from the page.

Parameters:

Name Type Description
name string The name of the cookie to be deleted.

GetCookieNamed(name)

Gets a cookie with the specified name.

Parameters:

Name Type Description
name string The name of the cookie to retrieve.