Core package guide
Open applications, click, type and read text in Windows apps. These simple selectors suit existing automations. For new UI work, use Capture: it finds controls better.
Version 2.17.1. Installed versions can differ. Examples are illustrative and not tested. See Packages.
Prerequisites
- A Windows Device that is unlocked and signed in, with the desktop visible. Real clicks and keys fail on a locked or disconnected desktop.
- The app must show its controls to Windows accessibility tools (Windows UI Automation). Most standard apps do.
- To try the examples, open one empty Notepad. If its title is not
Notepad, use its real title. Close it after. - Copy real control IDs and names from an inspector tool. Do not guess them.
- If the window or control is not found, the step fails.
- Number fields are whole numbers in the unit the table gives.
Shared fields
Click, Read text and Type use these fields to find the control.
| Input | Editor field | Type; default; editor rule | Value |
|---|---|---|---|
window | window | Stringdefault emptyoptional. | Part of the window title, for example Notepad. Upper or lower case does not matter. If two windows match, the newest app wins; two windows of the same app can tie. The step waits up to 5 seconds for the window. A text field, not a Window variable. |
automation | automation | Stringdefault emptyoptional. | The control's exact ID, copied from an inspector tool. It wins over name. Leave it empty for the Notepad text area. |
name | name | Stringdefault emptyoptional. | The control's exact name, used only when automation is empty. If both are empty, the step uses the first text area in the window, or the window itself. Use this only in a simple editor like Notepad. |
Actions
Click (click)
Click a control in a window. If the control cannot be clicked directly, the step moves the mouse to its center and clicks.
Inputs
Uses the shared fields: window, automationId, name.
Outputs
None.
Example
With Notepad open, set window=Notepad. Leave automationId and name empty.
Expected result
The Notepad text area gets the focus or a click.
Open application (openApp)
Start a program or open a file, like a double-click. The step does not wait for a window: add Wait for window after it.
Inputs
| Input | Editor field | Type; default; editor rule | Value |
|---|---|---|---|
path | path | Stringdefault emptyrequired. | A program name, a program path or a file, for example notepad.exe. Use a full path or a program name: a short path does not start in the automation folder. |
args | args | Stringdefault emptyoptional. | The command-line arguments as one text. Empty: no arguments. Put quotes around paths with spaces. |
Outputs
None.
Example
Set path=notepad.exe. Leave args empty.
Expected result
Notepad opens. The step does not wait for the window; add Wait for window after it. A program that does not exist fails. Close Notepad after the test.
Read text (readText)
Read the text of a control. If it has no text, you get its name.
Inputs
Uses the shared fields: window, automationId, name.
Outputs
| Output | Type | Value |
|---|---|---|
text | String | The control's text, or its name if it has no text. A field that can hold text but is empty gives empty text. |
Example
Type Invoice sample into an empty Notepad. Set window=Notepad and leave automationId and name empty. Put output text in String $readBack$.
Expected result
$readBack$ contains Invoice sample, maybe with line endings. A read right after typing can get only the first part, until the app has processed all keys.
Send keys (sendKeys)
Old action, kept so saved steps still run. New steps cannot add it: use Keystrokes. It sends keys to the window that has the focus.
Inputs
| Input | Editor field | Type; default; editor rule | Value |
|---|---|---|---|
keys | keys | Stringdefault emptyrequired. | ^ Ctrl, % Alt, + Shift, each for the next key only. {ENTER} presses Enter; other key names in braces work too. No key groups. Not the same as the Keystrokes [ ] format. |
Outputs
None.
Example
In a saved Send keys step, click into an empty Notepad. Set keys=Invoice sample{ENTER}Ready. Do not use square brackets here.
Expected result
Notepad contains Invoice sample, a new line and Ready. An unknown key name or a missing } fails. The focus is not locked: if another app comes to the front, it gets the keys.
Type (type)
Type text into a control. Most fields are replaced. Some get the text at the cursor, so clear them first.
Inputs
| Input | Editor field | Type; default; editor rule | Value |
|---|---|---|---|
text | text | Stringdefault emptyrequired. | The text, typed as is. Brackets are not key names here. A writable field is replaced; otherwise the text goes in at the cursor or selection. |
Also uses the shared fields: window, automationId, name.
Outputs
None.
Example
With an empty Notepad open, set window=Notepad and text=Invoice sample. Leave automationId and name empty.
Expected result
Notepad contains Invoice sample. Typing at the cursor does not clear a document that already has text.
Wait for window (waitWindow)
Wait until a window whose title contains the text appears. Use it after Open application.
Inputs
| Input | Editor field | Type; default; editor rule | Value |
|---|---|---|---|
title | title | Stringdefault emptyoptional. | Part of the title, for example Notepad. Upper or lower case does not matter. Empty can match any window with a title, so give a title. |
timeout | timeout | Numberdefault 30000optional. | Milliseconds to wait; default 30000. Checks every 250 ms. 0 or less checks once. |
Outputs
None. The step only waits; it does not change the app.
Example
Start Notepad. Set title=Notepad and timeoutMs=10000.
Expected result
The step ends when a matching window appears within 10 seconds. If none appears, it fails with window not found. It does not give a Window variable.