Przejdź do głównej treści

getClipboard

Get the content of the system clipboard as a base64-encoded string.

Note: Falls back to the deprecated Appium 2 protocol endpoint if the driver does not support the mobile: execute method.

Android only supports the plaintext content type.

Usage​

await browser.getClipboard(contentType)

Parameters​

NameTypeDetails
contentType
optional
stringContent type to retrieve (e.g. 'plaintext', 'image', 'url'). Android only supports 'plaintext'.

Example​

getClipboard.js
it('should get the clipboard content', async () => {
const content = await browser.getClipboard()
const decoded = Buffer.from(content, 'base64').toString('utf8')
})

Returns​

  • <Promise<string>> returns: Base64-encoded clipboard content.

Support​

Support for ios Support for android

Supported platforms: iOS, Android

uwaga

Refer to the official Appium driver documentation to see which driver versions support this command.

Welcome! How can I help?

WebdriverIO AI Copilot