Desktop resource provides desktop automation capabilities for controlling GUI applications, taking screenshots, and managing windows. Note: Desktop automation requires a template with desktop dependencies installed.
Accessing Desktop Resource
VNC Server
start_vnc()
Start VNC server for remote desktop access.
VNCInfo object with URL, port, and display information
Example:
stop_vnc()
Stop VNC server.
get_vnc_status()
Get VNC server status.
Mouse Control
click()
Click at coordinates.
x,y(int): Screen coordinatesbutton(str): Mouse button -"left","right", or"middle"(default:"left")clicks(int): Number of clicks (default: 1)
move()
Move mouse to coordinates.
drag()
Drag mouse from one point to another.
scroll()
Scroll at coordinates.
Keyboard Control
type()
Type text.
press()
Press a key.
combination()
Press key combination.
Clipboard
clipboard_get()
Get clipboard contents.
clipboard_set()
Set clipboard contents.
Screenshots
screenshot()
Capture full screen screenshot.
screenshot_region()
Capture screenshot of specific region.
x,y(int): Top-left coordinateswidth,height(int): Region dimensions
Screen Recording
start_recording()
Start screen recording.
stop_recording()
Stop screen recording.
get_recording_status()
Get recording status.
Window Management
list_windows()
List all windows.
focus_window()
Focus a window.
close_window()
Close a window.
Error Handling
Desktop automation requires specific dependencies. If not available, methods raiseDesktopNotAvailableError:
Examples
Basic Automation
Form Filling
Related
- Sandbox Class - Main sandbox class
- Errors - Error handling

