pub enum Action {
Show 25 variants
Click {
scope: String,
selector: SelectorPath,
},
DoubleClick {
scope: String,
selector: SelectorPath,
},
Hover {
scope: String,
selector: SelectorPath,
},
ScrollIntoView {
scope: String,
selector: SelectorPath,
},
ClickAt {
scope: String,
selector: SelectorPath,
x_pct: f64,
y_pct: f64,
kind: ClickType,
},
TypeText {
scope: String,
selector: SelectorPath,
text: String,
},
PressKey {
scope: String,
selector: SelectorPath,
key: String,
},
Focus {
scope: String,
selector: SelectorPath,
},
Invoke {
scope: String,
selector: SelectorPath,
},
ActivateWindow {
scope: String,
},
MinimizeWindow {
scope: String,
},
CloseWindow {
scope: String,
},
SetValue {
scope: String,
selector: SelectorPath,
value: String,
},
DismissDialog {
scope: String,
},
ClickForegroundButton {
name: String,
},
ClickForeground {
name: String,
},
NoOp,
Sleep {
duration: Duration,
},
WriteOutput {
key: String,
path: String,
},
Extract {
key: String,
scope: String,
selector: SelectorPath,
attribute: ExtractAttribute,
multiple: bool,
local: bool,
},
Eval {
key: String,
expr: String,
output: Option<String>,
},
Exec {
command: String,
args: Vec<String>,
key: Option<String>,
},
MoveFile {
source: String,
destination: String,
},
BrowserNavigate {
scope: String,
url: String,
},
BrowserEval {
scope: String,
expr: String,
key: Option<String>,
},
}Variants§
Click
Left-click the centre of the element found by selector under scope.
DoubleClick
Double-click the centre of the element found by selector under scope.
Hover
Move the mouse cursor to the centre of the element without clicking. Useful for triggering hover menus or tooltips.
ScrollIntoView
Scroll ancestor containers until the element is within their visible viewport. Hovers each scrollable ancestor and sends wheel events, stopping as soon as the element’s bounding box is fully visible or it stops moving (meaning the container doesn’t scroll further).
ClickAt
Click at a fractional position within the element’s bounding box.
TypeText
Type text into the element found by selector under scope.
PressKey
Send a key expression (e.g. "{ENTER}", "{TAB}") to the element.
Focus
Give keyboard focus to the element found by selector under scope.
Invoke
Activate an element via UIA IInvokePattern::Invoke().
Unlike Click, Invoke does not require a valid bounding rect, so it
works on elements that are scrolled out of view (bounds (0,0,1,1)).
Falls back to Click when the element does not support InvokePattern.
Prefer this over Click + ScrollIntoView for items in WinUI/UWP
scrollable lists where mouse-wheel scrolling causes elastic snap-back.
ActivateWindow
Bring the window for scope to the foreground and restore it if minimized.
MinimizeWindow
Minimize the window for scope.
CloseWindow
Close the window for scope via its close button (sends WM_CLOSE).
SetValue
Set the value of an edit / combo-box directly via IValuePattern.
DismissDialog
Find the first dialog child of scope and close it.
ClickForegroundButton
Click a button named name inside the current foreground window.
ClickForeground
Click any element named name in the foreground window tree.
NoOp
Do nothing. Used as a placeholder action when a step only waits.
Sleep
Pause for the given duration before the expect condition is evaluated.
Useful after Hover to wait for a tooltip to appear before the next step.
WriteOutput
Write all values stored under key in the workflow output buffer to a
file. Each value is written as one CSV-quoted line. The file is created
or truncated. path supports {output.*} substitution.
Extract
Read text from one or more elements and store the values in the workflow
output buffer under key. The value is accessible via {output.<key>}
substitution in subsequent steps.
Extracts a text value from a matched element and stores it under key.
Whether the value is propagated to the parent workflow is controlled by
the workflow’s outputs declaration (set at load time, not in YAML).
Fields
selector: SelectorPathSelector path. Matches the first element unless multiple is true.
attribute: ExtractAttributeWhich text property to read from each matched element.
Eval
Evaluate a simple expression and store the result under key.
The expression language supports arithmetic (+, -, *, /, %),
comparison operators (==, <, <=, >, >=), logical operators
(&&, ||, both requiring Bool operands), parenthesised grouping,
single-quoted string literals, numeric literals, variable references
(local.key / bare identifier for locals, param.key for immutable
workflow params, output.key for the output buffer), and built-in
functions (split_lines, round, floor, ceil, min, max,
trim, len).
The result is always stored as a local variable (overwrite semantics). Bare identifiers resolve from locals first, falling back to the output buffer.
Fields
Exec
Spawn an external process and wait for it to exit.
Fails if the exit code is non-zero.
{output.*} tokens in command and args are substituted before execution.
Fields
MoveFile
Move a file from source to destination.
Fails if the destination already exists.
Creates the destination directory if it does not exist.
{output.*} tokens in both fields are substituted before execution.
Navigate the browser tab anchored to scope to url.
Polls document.readyState until "complete" before reporting success.
scope must name a Tab anchor.
BrowserEval
Evaluate a JavaScript expression in the browser tab anchored to scope.
Stores the string result in the output buffer under key.
scope must name a Tab anchor.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Action
impl JsonSchema for Action
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more