Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions AppiumLibrary/keywords/_applicationmanagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,26 @@ def get_device_time(self, format: Optional[str] = None):
"""
return self._current_application().get_device_time(format)

def get_clipboard_text(self):
"""Returns the current text content from the system clipboard.

Supports Android and iOS (XCUITest).
Note: On iOS 13+ real devices, WebDriverAgentRunner must be in the foreground to get clipboard content,
otherwise an empty string may be returned.
"""
return self._current_application().get_clipboard_text()

def set_clipboard_text(self, text):
"""Sets the given text into the system clipboard.

Supports Android and iOS (XCUITest).
Note: On iOS 15+ real devices, WebDriverAgentRunner must be in the foreground to set clipboard content.

Args:
- ``text`` - text to place on the clipboard
"""
self._current_application().set_clipboard_text(text)

def get_device_location(self):
"""Gets the device's current GPS location with human-readable address information.

Expand Down