测试人社区

Appium-delete-cookie

Delete Cookie

Delete the cookie with the given name (Web context only)
//: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/web/storage/delete-cookie.yml)

Example Usage

// Java
driver.manage().deleteCookieNamed("cookie_name");

# Python
self.driver.delete_cookie("cookie_name")

// Javascript
// webdriver.io example
driver.deleteCookies("cookie_name");

// wd example
await driver.deleteCookie("cookie_name");

# Ruby
# ruby_lib example
delete_cookie("cookie_name")

# ruby_lib_core example
@driver.delete_cookie("cookie_name")

# PHP
// TODO PHP sample

// C#
driver.Manage().Cookies.DeleteCookieNamed("cookie_name");

Support

Appium Server

Platform Driver Platform Versions Appium Version Driver Version
iOS XCUITest None None None
UIAutomation None None None
Android UiAutomator2 None None None
Espresso None None None
UiAutomator None None None
Mac Mac None None None
Windows Windows None None None

Appium Clients

HTTP API Specifications

Endpoint

DELETE /session/:sessionId/cookie/:name

URL Parameters

name description
session_id ID of the session to route the command to
name Name of cookie to delete

JSON Parameters

None

Response

null

See Also

官方链接为:http://appium.io/docs/en/commands/web/storage/delete-cookie