RPA.Desktop
Clear the system clipboard.
Click at the element indicated by locator.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
locator | str, Locator, None | None | Locator for click position |
action | Action | click | Click action, e.g. right click |
param locator: | Locator for click position |
---|---|
param action: | Click action, e.g. right click |
Examples
Click at a given pixel offset from the given locator.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
locator | str, Locator, None | None | Locator for click start position |
x | int | 0 | Click horizontal offset in pixels |
y | int | 0 | Click vertical offset in pixels |
action | Action | click | Click action, e.g. right 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 |
Examples
Close all opened applications.
Examples
Close given application. Needs to be started with this library.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
app | Application | null | App instance |
param app: | App instance |
---|
Examples
Return a new Region with the given dimensions.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
left | int | null | Left edge coordinate. |
top | int | null | Top edge coordinate. |
right | int | null | Right edge coordinate. |
bottom | int | null | Bottom edge coordinate. |
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 | Description |
---|---|---|---|
source | str, Locator | null | Locator for start position |
destination | str, Locator | null | Locator for destination position |
start_delay | float | 2.0 | Delay in seconds after pressing down mouse button |
end_delay | float | 0.5 | Delay in seconds before releasing mouse button |
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 | Description |
---|---|---|---|
locator | str, Locator | null | Locator string |
param locator: | Locator string |
---|
Examples
Find all elements defined by locator, and return their positions.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
locator | str, Locator | null | Locator string |
param locator: | Locator string |
---|
Examples
Read current value from system clipboard.
Examples
Returns the dimensions of the current virtual display, which is the combined size of all physical monitors.
Get current mouse position in pixel coordinates.
Examples
Draw an outline around all matching elements.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
locator | str, Locator | null |
Return a new Region with an offset from the given region.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
region | Region | null | The region to move. |
left | int | null | Amount of pixels to move left/right. |
top | int | null | Amount of pixels to move up/down. |
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 | Description |
---|---|---|---|
name_or_path | str | null | Name or path of application |
args | null | Command line arguments for application |
param name_or_path: | |
---|---|
Name or path of application | |
param args: | Command line arguments for application |
returns: | Application instance |
Examples
Press down mouse button and keep it pressed.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
button | Any | left |
Read text using OCR from the screen, or an area of the screen defined by the given locator.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
locator | str, None | None | Location of element to read text from |
invert | bool | False | Invert image colors, useful for reading white text on dark background |
param locator: | Location of element to read text from |
---|---|
param invert: | Invert image colors, useful for reading white text on dark background |
Usage examples:
Release mouse button that was previously pressed.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
button | Any | left |
Return a resized new Region from a given region.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
region | Region | null | The region to resize. |
left | int | 0 | Amount of pixels to resize left edge. |
top | int | 0 | Amount of pixels to resize top edge. |
right | int | 0 | Amount of pixels to resize right edge. |
bottom | int | 0 | Amount of pixels to resize bottom edge. |
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 | Description |
---|---|---|---|
confidence | float, None | None | Value from 1 to 100 |
param confidence: | |
---|---|
Value from 1 to 100 |
Set the default time to wait for elements.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
timeout | float | 3.0 | Time in seconds |
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 | Description |
---|---|---|---|
path | str, None | None | Path to screenshot. The string {index} will be replaced with an index number to avoid overwriting previous screenshots. |
locator | str, Locator, None | None | Element to crop screenshot to |
embed | bool | True | Embed screenshot into Robot Framework log |
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 one letter at a time.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
text | str | null | Text to write |
modifiers | str | null | Modifier or functions keys held during typing |
enter | bool | False | Press Enter / Return key after typing text |
param text: | Text to write |
---|---|
param modifiers: | |
Modifier or functions keys held during typing | |
param enter: | Press Enter / Return key after typing text |
Examples
Type text at the position indicated by given locator.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
locator | str, Locator | null | Locator of input element |
text | str | null | Text to write |
clear | bool | False | Clear element before writing |
enter | bool | False | Press Enter / Return key after typing text |
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 |
Examples
Wait for an element defined by locator to exist, or raise a TimeoutException if none were found within timeout.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
locator | str, Locator | null | Locator string |
timeout | float, None | None | |
interval | float | 0.5 |
param locator: | Locator string |
---|