Skip to content

AAIS Script Language

AAI Script (AAIS) is a small scripting language built on top of FindNode. It has simple syntax with a dozen commands, designed for quick tests rather than complex scripting.

Key Features

  • Object-based (not coordinate-based)
  • Works with mixed device environments
  • Multi-threaded execution across 1-50 devices
  • File extension: .tst

Commands Reference

click / longClick

Click or long-click on screen elements. If the element is not found, the script stops.

click OK
click "Sign In"
longClick "Delete Item"

open / restart

Launch or restart apps by package name or app name:

open com.example.myapp
restart "Chrome"

wait

Wait until a match is found or timeout expires (default: 5000ms):

wait "Loading complete"
wait "Ready" 10000

text

Enter text into input fields:

text "Hello World"           // first editable field
text 0 "Username"            // by position (0-indexed)
text "Enter name" "John"     // by hint string

press

Press keycodes or key names:

press Enter
press Back
press Home
press Power
press Tab

find

Scroll the screen until a match is found:

find "Settings"              // scroll down (default)
find "Settings" up           // scroll up
find "Settings" fromTop      // scroll from top
find "Settings" fromBottom   // scroll from bottom

exec

Load external files:

exec "login_test.tst"       // load AAIS file
exec "helper.js"            // load JavaScript file

Other Commands

CommandDescriptionExample
printOutput to logprint "Test passed"
delayPause (ms)delay 2000
checkToggle checkboxcheck "Remember me" true
progressSet sliderprogress "Volume" 50 0 100
getRetrieve infoget id "OK", get text "button1"
sendAaiSend FindNode commandsendAai {"query":"T:OK","action":"click"}

JavaScript Integration

AAIS scripts can embed JavaScript blocks with curly braces:

click "Start"
{
  var count = getOutput().count;
  if (count > 5) {
    saveVar("status", "many");
  }
}
print "Done"

Data flows between AAIS and JavaScript via getOutput() and template literals ${expression}.

Built-in Functions

FunctionDescription
getDevice()Current device object
getDevices()All selected devices array
saveVar(name, value)Store device-scoped variable
loadVar(name)Retrieve device-scoped variable
saveGlobalVar(name, value)Store global variable
loadGlobalVar(name)Retrieve global variable
doOnce()Returns true only on first execution
getOutput()Access FindNode command results
getArg()Retrieve command-line arguments
log(message)Append to Runner log file
throw(message)Stop execution with error

Creating Scripts

  1. Create a .tst file using any text editor
  2. Or use the Record and Replay tool (select Object mode)

Running Scripts

Use the Runner interface in MDCC or WDM:

Write .tst file

Open Runner

Select devices

Run script

View logs & results

rjckb2

Example: Tesla VIN Retrieval

open Tesla
find "VIN:"
{
  var output = getOutput();
  var vin = output.retval;
  saveGlobalVar("vin", vin);
  log("VIN: " + vin);
}
print "VIN saved"

Example: Conditional App Launch

{
  var args = getArg();
  var appIndex = args[0] || 0;
}
open ${appIndex == 0 ? "Chrome" : "Firefox"}
wait "Ready" 5000
click "Search"

Sigma RT Total Control Documentation