RPA.Desktop
Clear the system clipboard.
Click at a given pixel offset from the given locator.
Arguments
Argument | Type | Default value |
---|---|---|
locator | str, Locator, None | None |
x | int | 0 |
y | int | 0 |
action | Action | click |
param locator: | Locator for click start position |
---|---|
param x: | Click horizontal offset in pixels |
param y: | Click vertical offset in pixels |
param action: | Click action, e.g. right click |
Usage
Close all opened applications.
Usage
Close given application. Needs to be started with this library.
Arguments
Argument | Type | Default value |
---|---|---|
app | Application | null |
param app: | App instance |
---|
Usage
Return a new Region with the given dimensions.
Arguments
Argument | Type | Default value |
---|---|---|
left | int | null |
top | int | null |
right | int | null |
bottom | int | null |
param left: | Left edge coordinate. |
---|---|
param top: | Top edge coordinate. |
param right: | Right edge coordinate. |
param bottom: | Bottom edge coordinate. |
Usage examples:
Drag mouse from source to destination while holding the left mouse button.
Arguments
Argument | Type | Default value |
---|---|---|
source | str, Locator | null |
destination | str, Locator | null |
start_delay | float | 2.0 |
end_delay | float | 0.5 |
param source: | Locator for start position |
---|---|
param destination: | Locator for destination position |
param start_delay: | Delay in seconds after pressing down mouse button |
param end_delay: | Delay in seconds before releasing mouse button |
Find an element defined by locator, and return its position. Raises ElementNotFound if` no matches were found, or MultipleElementsFound if there were multiple matches.
Arguments
Argument | Type | Default value |
---|---|---|
locator | str, Locator | null |
param locator: | Locator string |
---|
Usage
Read current value from system clipboard.
Usage
Returns the dimensions of the current virtual display, which is the combined size of all physical monitors.
Get current mouse position in pixel coordinates.
Usage
Draw an outline around all matching elements.
Arguments
Argument | Type | Default value |
---|---|---|
locator | str, Locator | null |
Return a new Region with an offset from the given region.
Arguments
Argument | Type | Default value |
---|---|---|
region | Region | null |
left | int | null |
top | int | null |
param region: | The region to move. |
---|---|
param left: | Amount of pixels to move left/right. |
param top: | Amount of pixels to move up/down. |
Usage examples:
Start a given application by name (if in PATH), or by path to executable.
Arguments
Argument | Type | Default value |
---|---|---|
name_or_path | str | null |
args | null |
param name_or_path: | Name or path of application |
---|---|
param args: | Command line arguments for application |
returns: | Application instance |
Usage
Read text using OCR from the screen, or an area of the screen defined by the given locator.
Arguments
Argument | Type | Default value |
---|---|---|
locator | str, None | None |
invert | bool | False |
param locator: | Location of element to read text from |
---|---|
param invert: | Invert image colors, useful for reading white text on dark background |
Usage examples:
Return a resized new Region from a given region.
Arguments
Argument | Type | Default value |
---|---|---|
region | Region | null |
left | int | 0 |
top | int | 0 |
right | int | 0 |
bottom | int | 0 |
Extends edges the given amount outward from the center, i.e. positive left values move the left edge to the left.
param region: | The region to resize. |
---|---|
param left: | Amount of pixels to resize left edge. |
param top: | Amount of pixels to resize top edge. |
param right: | Amount of pixels to resize right edge. |
param bottom: | Amount of pixels to resize bottom edge. |
Usage examples:
Set the default template matching confidence.
Arguments
Argument | Type | Default value |
---|---|---|
confidence | float, None | None |
param confidence: | Value from 1 to 100 |
---|
Set the default time to wait for elements.
Arguments
Argument | Type | Default value |
---|---|---|
timeout | float | 3.0 |
param timeout: | Time in seconds |
---|
Take a screenshot of the whole screen, or an element identified by the given locator.
Arguments
Argument | Type | Default value |
---|---|---|
path | str, None | None |
locator | str, Locator, None | None |
embed | bool | True |
param path: | Path to screenshot. The string {index} will be replaced with an index number to avoid overwriting previous screenshots. |
---|---|
param locator: | Element to crop screenshot to |
param embed: | Embed screenshot into Robot Framework log |
Type text at the position indicated by given locator.
Arguments
Argument | Type | Default value |
---|---|---|
locator | str, Locator | null |
text | str | null |
clear | bool | False |
enter | bool | False |
param locator: | Locator of input element |
---|---|
param text: | Text to write |
param clear: | Clear element before writing |
param enter: | Press Enter / Return key after typing text |
Usage
Wait for an element defined by locator to exist, or raise a TimeoutException if none were found within timeout.
Arguments
Argument | Type | Default value |
---|---|---|
locator | str, Locator | null |
timeout | float, None | None |
interval | float | 0.5 |
param locator: | Locator string |
---|