Class
CookiesManager

Class representing all cookie operations on the current browser machine.

Definition

Namespace:ArtOfTest.WebAii.ObjectModel

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class CookiesManager

Inheritance: objectCookiesManager

Methods

Delete a cookie from the machine.

Declaration

cs-api-definition
public bool DeleteCookie(Cookie cookie)

Parameters

cookie

Cookie

The cookie to delete. The cookie must have a name and domain

Returns

bool

True/False whether the cookie deletion passed or failed.

DeleteCookie(string)

DeleteCookie using the domain name

Declaration

cs-api-definition
public void DeleteCookie(string domain)

Parameters

domain

string

The url or domain associated with the cookie to delete.

Example

DeleteCookie("mail.google.com") or DeleteCookie("facebook.com")

GetCookies(Uri)

Gets all cookies for a specific uri

Declaration

cs-api-definition
public CookieCollection GetCookies(Uri uri)

Parameters

uri

Uri

The url to get the cookies for (i.e. http://www.google.com)

Returns

CookieCollection

The collection of cookies stored on this machine for the associated browser.

GetCookies(string)

Gets all cookies for a specific url

Declaration

cs-api-definition
public CookieCollection GetCookies(string url)

Parameters

url

string

The url to get the cookies for (i.e. http://www.google.com)

Returns

CookieCollection

The collection of cookies stored on this machine for the associated browser.

Set a new cookie or modify an existing one. This methods will only consider the following cookie properties (Name, Value, Domain, Path and Expires)

Declaration

cs-api-definition
public bool SetCookie(Cookie cookie)

Parameters

cookie

Cookie

The cookie to set on the machine for current browser.

Returns

bool

True/False whether the setting passed or failed.