Skip to main content

Action

Enum Action 

Source
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.

Fields

§scope: String
§selector: SelectorPath
§

DoubleClick

Double-click the centre of the element found by selector under scope.

Fields

§scope: String
§selector: SelectorPath
§

Hover

Move the mouse cursor to the centre of the element without clicking. Useful for triggering hover menus or tooltips.

Fields

§scope: String
§selector: SelectorPath
§

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).

Fields

§scope: String
§selector: SelectorPath
§

ClickAt

Click at a fractional position within the element’s bounding box.

Fields

§scope: String
§selector: SelectorPath
§x_pct: f64
§y_pct: f64
§

TypeText

Type text into the element found by selector under scope.

Fields

§scope: String
§selector: SelectorPath
§text: String
§

PressKey

Send a key expression (e.g. "{ENTER}", "{TAB}") to the element.

Fields

§scope: String
§selector: SelectorPath
§

Focus

Give keyboard focus to the element found by selector under scope.

Fields

§scope: String
§selector: SelectorPath
§

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.

Fields

§scope: String
§selector: SelectorPath
§

ActivateWindow

Bring the window for scope to the foreground and restore it if minimized.

Fields

§scope: String
§

MinimizeWindow

Minimize the window for scope.

Fields

§scope: String
§

CloseWindow

Close the window for scope via its close button (sends WM_CLOSE).

Fields

§scope: String
§

SetValue

Set the value of an edit / combo-box directly via IValuePattern.

Fields

§scope: String
§selector: SelectorPath
§value: String
§

DismissDialog

Find the first dialog child of scope and close it.

Fields

§scope: String
§

ClickForegroundButton

Click a button named name inside the current foreground window.

Fields

§name: String
§

ClickForeground

Click any element named name in the foreground window tree.

Fields

§name: String
§

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.

Fields

§duration: Duration
§

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.

Fields

§path: String
§

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

§key: String

Output key. Accessible as {output.<key>} in later steps.

§scope: String

Anchor name that provides the search root.

§selector: SelectorPath

Selector path. Matches the first element unless multiple is true.

§attribute: ExtractAttribute

Which text property to read from each matched element.

§multiple: bool

If true, extract all matching elements. If false (default), extract only the first match.

§local: bool

If true, store in local scope only — not propagated to parent workflow. Set automatically from the workflow’s outputs list; not read from YAML.

§

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

§key: String

Key under which the result is stored in local variables.

§expr: String

Expression to evaluate.

§output: Option<String>

If set, also appends the result to the output buffer under this key.

§

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

§command: String

Executable path or command name (resolved via PATH).

§args: Vec<String>

Arguments to pass to the process.

§key: Option<String>

If set, stdout is captured and each line stored in the output buffer under this key.

§

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.

Fields

§source: String
§destination: String
§

BrowserNavigate

Navigate the browser tab anchored to scope to url. Polls document.readyState until "complete" before reporting success. scope must name a Tab anchor.

Fields

§scope: String
§

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.

Fields

§scope: String
§expr: String
§key: Option<String>

Output key to store the result. If omitted the result is discarded.

Implementations§

Source§

impl Action

Source

pub fn describe(&self) -> String

Short human-readable description for trace output.

Source

pub fn execute<D: Desktop>( &self, dom: &mut ShadowDom<D>, desktop: &D, output: &mut Output, locals: &mut HashMap<String, String>, params: &HashMap<String, String>, ) -> Result<(), AutomataError>

Source

pub fn apply_output( &self, locals: &HashMap<String, String>, output: &Output, ) -> Self

Return a clone with all {output.<key>} tokens substituted in string fields. Checks the output buffer first (first value per key), then local vars.

Trait Implementations§

Source§

impl Clone for Action

Source§

fn clone(&self) -> Action

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Action

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Action

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Action

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,