This documentation is deprecated. Please refer to the README in the Appium repository or Appium 2.0 documentation.

  Edit this Doc Get Clipboard

Get the content of the system clipboard

Example Usage

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


// example

// wd example
await driver.getClipboard();

# ruby_lib example

# ruby_lib_core example

// CSharp Code here


Get the content of the system clipboard

(For iOS 13+ real devices) Apple security preferences require the WebDriverAgentRunner application to be in foreground in order to be able to receive the system clipboard content. Otherwise an empty string is always returned. Consider using Activate App and Background App to change the foreground application. Activate App command cannot launch the WebDriverAgent properly on some environments. It depends on XCTest framework by Apple. Then, you should launch the WebDriverAgent using its Springboard's application icon. Follow the example below. 1. Open Springboard, @driver.activate_app ''. 2. Find the WDA icon with @driver.find_element :accessibility_id, 'WebDriverAgentRunner-Runner' (It should be visible on the screen) and click it. 3. Call the get clipboard API. 4. Open the application under test with the Activate App.


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
Python All
Javascript (WebdriverIO) All
Javascript (WD) All
Ruby All Android iOS
C# None

HTTP API Specifications


POST /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.


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

See Also