Command Cheat Sheet
All Commands Quick Reference
Interaction Commands (13)
| Command | Purpose | Example |
|---|---|---|
tapOn | Tap an element | tapOn: "Login" |
longPressOn | Long press an element | longPressOn: "File" |
doubleTapOn | Double tap an element | doubleTapOn: "Image" |
swipe | Swipe | swipe: { direction: UP } |
scroll | Scroll once | scroll |
scrollUntilVisible | Scroll until visible | See Intermediate |
inputText | Input text | inputText: "hello" |
eraseText | Erase text | eraseText or eraseText: 10 |
pressKey | Press a key | pressKey: Home |
back | Go back | back |
hideKeyboard | Hide keyboard | hideKeyboard or hide keyboard |
copyTextFrom | Copy element text | copyTextFrom: { id: "code" } |
pasteText | Paste text | pasteText |
Verification Commands (4)
| Command | Purpose | Timeout |
|---|---|---|
assertVisible | Assert element is visible | 17 seconds |
assertNotVisible | Assert element is not visible | 7 seconds |
assertTrue | Assert script condition | -- |
extendedWaitUntil | Custom wait | Custom |
App Management (6)
| Command | Purpose |
|---|---|
launchApp | Launch App |
stopApp | Stop App |
killApp | Force kill App |
clearState | Clear App data |
openLink | Open a link |
setPermissions | Set permissions |
Flow Control (4)
| Command | Purpose |
|---|---|
repeat | Loop execution |
retry | Retry on failure |
runFlow | Sub-flow (inline commands or file reference) |
branch | Conditional branching |
Data and Scripting (10)
| Command | Purpose |
|---|---|
defineVariables | Define variables |
evalScript | Execute JS expression |
runScript | Execute JS (with variable injection) |
shell | Shorthand for evalScript |
httpRequest | Make HTTP request |
setClipboard | Set clipboard |
inputRandomText | Random text |
inputRandomNumber | Random number |
inputRandomEmail | Random email |
inputRandomPersonName | Random person name |
Device Control (5)
| Command | Purpose |
|---|---|
sleep | Delay / wait |
setLocation | Set GPS location |
setAirplaneMode | Set airplane mode |
takeScreenshot | Take screenshot |
waitForAnimationToEnd | Wait for animation to end |
All Key Names
The following key names can be used with the pressKey command:
Navigation Keys
| Key | Description |
|---|---|
Home | Home button |
Back | Back button |
Menu | Menu button |
Search | Search button |
Enter | Enter/confirm |
Tab | Tab key |
Escape | ESC key |
DpadUp | D-pad up |
DpadDown | D-pad down |
DpadLeft | D-pad left |
DpadRight | D-pad right |
DpadCenter | D-pad center |
PageUp | Page up |
PageDown | Page down |
Editing Keys
| Key | Description |
|---|---|
Delete | Delete key (backspace) |
Backspace | Backspace key |
ForwardDelete | Forward delete |
Space | Space key |
Volume and Power
| Key | Description |
|---|---|
VolumeUp | Volume up |
VolumeDown | Volume down |
Power | Power button |
Lock | Lock screen |
Phone
| Key | Description |
|---|---|
Call | Answer call |
EndCall | End call |
Letters and Numbers
| Key | Description |
|---|---|
A ~ Z | Letter keys |
0 ~ 9 | Number keys |
Numpad0 ~ Numpad9 | Numpad digits |
Symbols
| Key | Description |
|---|---|
Comma | Comma , |
Period | Period . |
Grave | Backtick ` |
Minus | Minus - |
Equals | Equals = |
Plus | Plus + |
LeftBracket | Left bracket [ |
RightBracket | Right bracket ] |
Backslash | Backslash \ |
Semicolon | Semicolon ; |
Apostrophe | Apostrophe ' |
Slash | Slash / |
At | At sign @ |
Star | Asterisk * |
Pound | Hash # |
Other
| Key | Description |
|---|---|
Camera | Camera button |
Clear | Clear key |
Default Timeouts and Limits
| Parameter | Default Value | Description |
|---|---|---|
| Element lookup timeout | 17,000 ms | Default wait time for commands like assertVisible |
| Optional element lookup timeout | 7,000 ms | Wait time when optional: true |
| Screen settle timeout | 1,500 ms | Time to wait for screen to settle after tap/swipe |
| Script execution timeout | 200 ms | JS expression evaluation timeout |
| Animation wait timeout | 15,000 ms | Default timeout for waitForAnimationToEnd |
| Default swipe duration | 400 ms | Default duration for swipe |
| Consecutive tap interval | 100 ms | Default delay value for tapOn |
| Scroll-to-find timeout | 20,000 ms | Default timeout for scrollUntilVisible |
| Default scroll speed | 40 | speed parameter for scrollUntilVisible (0~100) |
| Maximum loop iterations | 1,000 | Maximum iterations for repeat |
| Default loop duration | 30 minutes | Maximum duration when repeat has no duration set |
| Default retry count | 1 | Default value when retry has no maxRetries set |
| Maximum retry count | 3 | Upper limit for retry's maxRetries |
| Exception handler retries per command | 5 | Maximum retries by exception handlers for a single command |
| Maximum erase characters | 50 | Default deletion limit for eraseText |
| Screen settle wait upper limit | 30,000 ms | Maximum value for waitToSettleTimeoutMs |
| HTTP retry interval | 3,000 ms | Default interval for httpRequest retry |
FAQ
Q: What should I do when tapOn can't find an element?
- Verify the text matches exactly (including case and spaces)
- Try using regex:
tapOn: "Login.*" - Try using an ID:
tapOn: { id: "btn_login" } - Add
optional: trueto prevent errors
Q: How do I adapt flows for different devices?
Use percentage coordinates instead of absolute coordinates:
yaml
# Not recommended (only works for a specific resolution)
- tapOn: { point: "540,1200" }
# Recommended (works at any resolution)
- tapOn: { point: "50%,60%" }Q: How should I choose the random range for sleep?
- Quick operation intervals:
sleep: [500, 1500](0.5~1.5 seconds) - Simulating reading/browsing:
sleep: [3000, 8000](3~8 seconds) - Waiting for loading to complete:
sleep: [5000, 10000](5~10 seconds)
Q: Can chance and when be used together?
When both are specified, when takes effect and chance is ignored. They are mutually exclusive -- chance: 0.3 is essentially equivalent to when: { true: "${Math.random() < 0.3}" }, just more convenient to write.
Q: What unit does repeat's duration use?
Milliseconds (ms). Common conversions:
- 1 second = 1,000
- 1 minute = 60,000
- 10 minutes = 600,000
- 30 minutes = 1,800,000
- 1 hour = 3,600,000
Q: Are variables modified in a sub-flow visible outside?
Yes. Variables modified by evalScript exist in the global scope, so changes made in a sub-flow take effect immediately in the outer flow.
Q: How do I write httpRequest's jsonPath?
Use a dot-separated path starting from the JSON root:
json
{ "data": { "user": { "name": "John" } } }Corresponding jsonPath: data.user.name, result is "John".
