Set Clipboard
Set the content of the system clipboard
//: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
Example Usage
// Java
// base64Content is Base64-encoded content
driver.setClipboard("label", ClipboardContentType.PLAINTEXT, base64Content);
driver.setClipboardText("happy testing");
# Python
self.driver.set_clipboard('happy testing')
self.driver.set_clipboard_text('happy testing')
// Javascript
// webdriver.io example
driver.setClipboard('happy testing', 'plaintext')
// wd example
await driver.setClipboard('happy testing', 'plaintext')
# Ruby
# ruby_lib example
set_clipboard content: 'happy testing'
# ruby_lib_core example
@driver.set_clipboard content: 'happy testing'
# PHP
// PHP Code here
// C#
// CSharp Code here
Description
Set 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 | appium.github.io |
| Javascript (WebdriverIO) | All | |
| Javascript (WD) | All | github.com |
| Ruby | All | iOS Android |
| PHP | None | github.com |
| C# | None | github.com |
HTTP API Specifications
Endpoint
POST /session/:session_id/appium/device/set_clipboard
URL Parameters
| name | description |
|---|---|
| session_id | ID of the session to route the command to |
JSON Parameters
| name | type | description |
|---|---|---|
| content | String |
The actual base64 encoded clipboard content. |
| contentType | string |
The type of the content to get. Plaintext, Image, URL. Android supports only plaintext. |
| label | string |
Clipboard data label for Android. |
Response
Response from Appium server (string)
See Also
官方链接为:Set Clipboard - Appium