DefaultSeleniumCreateCookie Method WebDriver
Create a new cookie whose path and domain are same with those of current page under test, unless you specified a path for this cookie explicitly.

Namespace: Selenium
Assembly: ThoughtWorks.Selenium.Core (in ThoughtWorks.Selenium.Core.dll) Version: 3.1.0
Syntax

public void CreateCookie(
	string nameValuePair,
	string optionsString
)

Parameters

nameValuePair
Type: SystemString
name and value of the cookie in a format "name=value"
optionsString
Type: SystemString
options for the cookie. Currently supported options include 'path', 'max_age' and 'domain'. the optionsString's format is "path=/path/, max_age=60, domain=.foo.com". The order of options are irrelevant, the unit of the value of 'max_age' is second. Note that specifying a domain that isn't a subset of the current domain will usually fail.

Implements

ISeleniumCreateCookie(String, String)
See Also

Reference