Get Clipboard

Get the content of the system clipboard

Example Usage

// Java
driver.getClipboard(ClipboardContentType.PLAINTEXT); // get plaintext
driver.getClipboardText();

# Python
self.driver.get_clipboard()
self.driver.get_clipboard_text()

// Javascript
// webdriver.io example
await driver.getClipboard();



[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/get-clipboard.yml)
// wd example
await driver.getClipboard();

# Ruby
# ruby_lib example
get_clipboard


[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/get-clipboard.yml)
# ruby_lib_core example
@driver.get_clipboard

# PHP
// PHP Code here

// C#
// CSharp Code here

Description

Get the content of the system clipboard

Support

Appium Server

Platform Driver Platform Versions Appium Version Driver Version
iOS XCUITest 9.3+ 1.6.0+ All
UIAutomation None None None
Android Espresso ?+ 1.9.0+ All
UiAutomator2 ?+ 1.6.0+ All
UiAutomator None None None
Mac Mac None None None
Windows Windows None None None

Appium Clients

Language Support Documentation
Java All seleniumhq.github.io
Python All github.com
Javascript (WebdriverIO) All
Javascript (WD) All github.com
Ruby All Android iOS
PHP None github.com
C# None github.com

HTTP API Specifications

Endpoint

POST /wd/hub/session/:session_id/appium/device/get_clipboard

URL Parameters

name description
session_id ID of the session to route the command to

JSON Parameters

name type description
contentType string The type of the content to get. Plaintext, Image, URL. Android supports only plaintext.

Response

Clipboard content as base64-encoded string or an empty string if the clipboard is empty (string)

See Also