Skip to content

Command Cheat Sheet

All Commands Quick Reference

Interaction Commands (13)

CommandPurposeExample
tapOnTap an elementtapOn: "Login"
longPressOnLong press an elementlongPressOn: "File"
doubleTapOnDouble tap an elementdoubleTapOn: "Image"
swipeSwipeswipe: { direction: UP }
scrollScroll oncescroll
scrollUntilVisibleScroll until visibleSee Intermediate
inputTextInput textinputText: "hello"
eraseTextErase texteraseText or eraseText: 10
pressKeyPress a keypressKey: Home
backGo backback
hideKeyboardHide keyboardhideKeyboard or hide keyboard
copyTextFromCopy element textcopyTextFrom: { id: "code" }
pasteTextPaste textpasteText

Verification Commands (4)

CommandPurposeTimeout
assertVisibleAssert element is visible17 seconds
assertNotVisibleAssert element is not visible7 seconds
assertTrueAssert script condition--
extendedWaitUntilCustom waitCustom

App Management (6)

CommandPurpose
launchAppLaunch App
stopAppStop App
killAppForce kill App
clearStateClear App data
openLinkOpen a link
setPermissionsSet permissions

Flow Control (4)

CommandPurpose
repeatLoop execution
retryRetry on failure
runFlowSub-flow (inline commands or file reference)
branchConditional branching

Data and Scripting (10)

CommandPurpose
defineVariablesDefine variables
evalScriptExecute JS expression
runScriptExecute JS (with variable injection)
shellShorthand for evalScript
httpRequestMake HTTP request
setClipboardSet clipboard
inputRandomTextRandom text
inputRandomNumberRandom number
inputRandomEmailRandom email
inputRandomPersonNameRandom person name

Device Control (5)

CommandPurpose
sleepDelay / wait
setLocationSet GPS location
setAirplaneModeSet airplane mode
takeScreenshotTake screenshot
waitForAnimationToEndWait for animation to end

All Key Names

The following key names can be used with the pressKey command:

KeyDescription
HomeHome button
BackBack button
MenuMenu button
SearchSearch button
EnterEnter/confirm
TabTab key
EscapeESC key
DpadUpD-pad up
DpadDownD-pad down
DpadLeftD-pad left
DpadRightD-pad right
DpadCenterD-pad center
PageUpPage up
PageDownPage down

Editing Keys

KeyDescription
DeleteDelete key (backspace)
BackspaceBackspace key
ForwardDeleteForward delete
SpaceSpace key

Volume and Power

KeyDescription
VolumeUpVolume up
VolumeDownVolume down
PowerPower button
LockLock screen

Phone

KeyDescription
CallAnswer call
EndCallEnd call

Letters and Numbers

KeyDescription
A ~ ZLetter keys
0 ~ 9Number keys
Numpad0 ~ Numpad9Numpad digits

Symbols

KeyDescription
CommaComma ,
PeriodPeriod .
GraveBacktick `
MinusMinus -
EqualsEquals =
PlusPlus +
LeftBracketLeft bracket [
RightBracketRight bracket ]
BackslashBackslash \
SemicolonSemicolon ;
ApostropheApostrophe '
SlashSlash /
AtAt sign @
StarAsterisk *
PoundHash #

Other

KeyDescription
CameraCamera button
ClearClear key

Default Timeouts and Limits

ParameterDefault ValueDescription
Element lookup timeout17,000 msDefault wait time for commands like assertVisible
Optional element lookup timeout7,000 msWait time when optional: true
Screen settle timeout1,500 msTime to wait for screen to settle after tap/swipe
Script execution timeout200 msJS expression evaluation timeout
Animation wait timeout15,000 msDefault timeout for waitForAnimationToEnd
Default swipe duration400 msDefault duration for swipe
Consecutive tap interval100 msDefault delay value for tapOn
Scroll-to-find timeout20,000 msDefault timeout for scrollUntilVisible
Default scroll speed40speed parameter for scrollUntilVisible (0~100)
Maximum loop iterations1,000Maximum iterations for repeat
Default loop duration30 minutesMaximum duration when repeat has no duration set
Default retry count1Default value when retry has no maxRetries set
Maximum retry count3Upper limit for retry's maxRetries
Exception handler retries per command5Maximum retries by exception handlers for a single command
Maximum erase characters50Default deletion limit for eraseText
Screen settle wait upper limit30,000 msMaximum value for waitToSettleTimeoutMs
HTTP retry interval3,000 msDefault interval for httpRequest retry

FAQ

Q: What should I do when tapOn can't find an element?

  1. Verify the text matches exactly (including case and spaces)
  2. Try using regex: tapOn: "Login.*"
  3. Try using an ID: tapOn: { id: "btn_login" }
  4. Add optional: true to 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".

Powered by VMOS Edge Team