MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / deleteCookie

Method deleteCookie

javascript/selenium-webdriver/lib/webdriver.js:2071–2078  ·  view source on GitHub ↗

* Deletes the cookie with the given name. This command is a no-op if there is * no cookie with the given name visible to the current page. * * @param {string} name The name of the cookie to delete. * @return {!Promise } A promise that will be resolved * when the cookie has be

(name)

Source from the content-addressed store, hash-verified

2069 * when the cookie has been deleted.
2070 */
2071 deleteCookie(name) {
2072 // Validate the cookie name is non-empty and properly trimmed.
2073 if (!name?.trim()) {
2074 throw new error.InvalidArgumentError('Cookie name cannot be empty')
2075 }
2076
2077 return this.driver_.execute(new command.Command(command.Name.DELETE_COOKIE).setParameter('name', name))
2078 }
2079
2080 /**
2081 * Retrieves all cookies visible to the current page. Each cookie will be

Callers

nothing calls this directly

Calls 2

setParameterMethod · 0.80
executeMethod · 0.65

Tested by

no test coverage detected