Tutorial · Extension

⚙️ Automation: the extension's AUTOMATE scripts

Write or record a journey in a Kalinotes note, replay it in one click, and get screenshots and results straight into the note. No testing tool to install.

⏱ ~10 min📶 Intermediate🧩 Extension

Why automate with Kalinotes?

An AUTOMATE is a small script placed in the JavaScript field of a note. The extension runs it on the page: it clicks, fills in forms, waits for responses, reads the results and stores them in the note. Your tests live in the same place as your feedback.

⏺

Record without coding

Click ⏺ and go through the journey yourself: the extension writes the script for you.

🔁

Replay endlessly

Login, contact form, checkout funnel: retest the same journey after every release, in one click.

📸

Evidence in the note

Screenshots and result comments are automatically added to the note that holds the test.

🐞

Reproducible bugs

The script describes every exact step: your developer replays the bug instead of guessing it.

🧪

Full acceptance testing

“Run All” chains every script in a list and writes a report with the status and duration of each test.

🔌

Your APIs in the loop

Call an API (GET or POST), check the response and adapt the rest of the script with conditions.

Get started in 3 steps

1

Open or create a note

From the Kalinotes extension, on the page you want to test. Save the note: this is required so that screenshots and comments can be attached to it.

2

Turn on AUTOMATE mode

In the note's JavaScript field, write exactly this first line:

#!AUTOMATE

The ⏺ (record) and ▶ (run) buttons appear in the section header. The content is no longer run as JavaScript: it is read command by command by the AUTOMATE engine.

3

Run it

Click ▶. A console appears at the bottom of the form and logs each step in real time. Click ⏹ to stop the running script.

Record a journey (Recorder)

The ⏺ button watches your actions on the page and generates the matching script.

  1. Click ⏺: recording starts (the button turns into ⏹ and blinks).
  2. Use the page normally: clicks, typing, drop-down lists…
  3. Click ⏹: the generated script appears in the field.
Your actionGenerated command
Click on a button or linkClickElement "selector"
Typing in a fieldFillElement "selector" "value"
Choice in a drop-down listSelectOption "selector" "value"
Form submissionSubmit "selector"
Navigation to another pageLoadUrl "url" + WaitUntilExist "body"
  • Clicking ⏺ again appends new actions to the end of the script, without erasing anything.
  • Passwords are masked ("***") with a comment reminding you to replace them.
  • A short pause (Sleep) is inserted after each click: 300 ms, or 1,000 ms after a link or a submit button.
  • If the page changes during recording, click ⏺ again to continue on the new page.
  • The resulting script is a starting point: adjust the selectors and wait times if needed, and add your conditions.

Syntax and variables

#!AUTOMATE # This is a comment (ignored) COMMAND argument1 "argument with spaces" $VARIABLE
  • One command per line. Empty lines and lines starting with # are ignored.
  • Arguments containing spaces go between quotes "..." or '...'.
  • For a CSS selector containing double quotes, use single quotes: '[name="email"]'.
  • Command names are case-insensitive: LoadUrl = LOADURL.
  • Variables start with $, are shared across the whole script and are replaced in every argument before each command.
  • The reserved variable $__SCREENSHOT__ holds the last screenshot taken by CopyPage when the note is not saved.
SetVal $NAME "Smith" FillElement "#name-field" $NAME

The commands

Selectors are CSS selectors (#id, .class, [name="..."]…): the command acts on the first element found.

CommandWhat it does
SetVal $VAR "value"Assigns a literal value to a variable
Input $VAR "Message"Shows an input box and stores the answer in the variable
Wget $VAR "url"Loads the text content of a URL (HTTP GET, no authentication) into a variable
WPost $VAR "url" "key=value" ...Sends an HTTP POST request and stores the response body in the variable
LoadUrl "url"Opens the URL in the active tab and waits for it to finish loading (15 s maximum)
Sleep msPauses the script for the given number of milliseconds
ScrollTo "selector"Scrolls the page to centre the element on screen
ClickElement "selector"Simulates a click on the first element matching the CSS selector
FillElement "selector" "value"Fills in a field (input, textarea) and fires the input and change events, so it also works with React, Vue…
SelectOption "selector" "value"Picks an option from a <select> drop-down by its value (value attribute) and fires the change event
Submit "selector"Submits the targeted form, or the parent form of the targeted element, respecting HTML5 validation
KeyPress "selector" "key"Simulates a key press on the element (keydown, keypress, keyup)
CopyElement "selector" $VARReads the value (field) or text of the first element found and stores it in the variable
WaitUntilExist "selector"Waits for the element to appear on the page (checked every 200 ms, 10 s maximum)
WaitUntilNoExist "selector"Waits for the element to disappear from the page (every 200 ms, 10 s maximum)
CopyPageTakes a screenshot of the visible part of the tab
CreateComment "text" [$VAR ...]Adds a comment to the note containing the script
Alert "message" [$VAR ...]Shows a floating notification on the page, which disappears after 10 seconds or on click, with a progress bar
If $VAR OPERATOR "value" GOTO :labelJumps to a label if the condition is true
:labelDefines a jump target for If … GOTO commands
StopStops the script immediately, without an error
# commentLine ignored by the engine, to document your script

Variables & input

SetVal $VAR "value"

Assigns a literal value to a variable.

SetVal $URL "https://example.com" SetVal $COUNTER "0"

Input $VAR "Message"

Shows an input box and stores the answer in the variable. Handy for asking for a login at launch rather than writing it in the script.

Input $FIRSTNAME "Enter your first name:"

HTTP requests

Wget $VAR "url"

Loads the text content of a URL (HTTP GET, no authentication) into a variable.

Wget $HTML "https://api.example.com/data.json"

WPost $VAR "url" "key=value" ...

Sends an HTTP POST request and stores the response body in the variable. With key=value pairs, it is sent as a form (application/x-www-form-urlencoded); with a single argument starting with {, as JSON (application/json). $NAME variables are replaced everywhere, including inside the JSON. An HTTP error (code ≥ 400) stops the script.

WPost $RESPONSE "https://api.example.com/submit" "name=$NAME" "email=$EMAIL" WPost $RESPONSE "https://api.example.com/submit" '{"name":"$NAME","email":"$EMAIL"}'

Navigation & timing

LoadUrl "url"

Opens the URL in the active tab and waits for it to finish loading (15 s maximum).

LoadUrl "https://example.com/login" LoadUrl $URL

Sleep ms

Pauses the script for the given number of milliseconds.

Sleep 500 Sleep 2000

ScrollTo "selector"

Scrolls the page to centre the element on screen. Useful to reveal content loaded on scroll (lazy loading).

ScrollTo "#results-section" ScrollTo "footer"

Page interactions

ClickElement "selector"

Simulates a click on the first element matching the CSS selector.

ClickElement "#login-btn" ClickElement "form button[type=submit]"

FillElement "selector" "value"

Fills in a field (input, textarea) and fires the input and change events, so it also works with React, Vue, etc.

FillElement "#email" "contact@example.com" FillElement "#password" $PASSWORD FillElement '[name="search"]' $TERM

SelectOption "selector" "value"

Picks an option from a <select> drop-down by its value (value attribute) and fires the change event.

SelectOption "#country" "FR" SelectOption '[name="title"]' "Mr"

Submit "selector"

Submits the targeted form, or the parent form of the targeted element, respecting HTML5 validation.

Submit "#form-login" Submit "form"

KeyPress "selector" "key"

Simulates a key press on the element (keydown, keypress, keyup). Common keys: Enter, Escape, Tab, ArrowDown, ArrowUp, Space, Backspace.

KeyPress "#search-input" "Enter" KeyPress "#modal" "Escape"

Reading & waiting

CopyElement "selector" $VAR

Reads the value (field) or text of the first element found and stores it in the variable.

CopyElement "#result" $TEXT CopyElement "input#token" $TOKEN

WaitUntilExist "selector"

Waits for the element to appear on the page (checked every 200 ms, 10 s maximum). The script stops with an error if the timeout is exceeded.

WaitUntilExist "#dashboard" WaitUntilExist ".alert-success"

WaitUntilNoExist "selector"

Waits for the element to disappear from the page (every 200 ms, 10 s maximum). Ideal for waiting until loading is finished.

WaitUntilNoExist ".spinner" WaitUntilNoExist "#loading-modal"

Results in Kalinotes

CopyPage

Takes a screenshot of the visible part of the tab. If the note is saved, the screenshot is attached to it; otherwise it is kept in the reserved variable $__SCREENSHOT__.

CopyPage

CreateComment "text" [$VAR ...]

Adds a comment to the note containing the script. Arguments are joined with a space. The note must be saved.

CreateComment "Test result:" $VALUE

Alert "message" [$VAR ...]

Shows a floating notification on the page, which disappears after 10 seconds or on click, with a progress bar.

Alert "Login successful!" Alert "Number of emails: " $COUNTER

Script logic

If $VAR OPERATOR "value" GOTO :label

Jumps to a label if the condition is true. Operators: == and != (text comparison), >, <, >=, <= (number comparison).

If $STATUS == "ok" GOTO :success If $SCORE > "90" GOTO :excellent

:label

Defines a jump target for If … GOTO commands.

:success CreateComment "Test passed"

Stop

Stops the script immediately, without an error. Useful to exit a conditional branch.

If $CODE != "200" GOTO :error Stop :error Alert "HTTP error: " $CODE

# comment

Line ignored by the engine, to document your script.

# Step 1: login

Chain your tests: Run All

As soon as at least one AUTOMATE script is visible in the list of notes, a Run All (N) button appears at the top of the list. It runs every script in display order.

  • Variables are shared: what one script stores in $MY_VAR is available to the next ones.
  • If a script fails, the sequence continues with the next one.
  • Clicking ✕ in the floating console cancels the sequence.
  • At the end, the 📊 Résultat AUTOMATE note (AUTOMATE result) is created if needed (with the URL of the active page) and receives a report comment: date and time, ✅ / ❌ status and duration of each script, overall summary, and the public variables (internal variables, prefixed with __, are excluded).

Examples

Test a login

#!AUTOMATE # Automatic login test script Input $LOGIN "Username:" Input $PASSWORD "Password:" LoadUrl "https://example.com/login" WaitUntilExist "#form-login" FillElement "#username" $LOGIN FillElement "#password" $PASSWORD ClickElement "#btn-submit" WaitUntilNoExist ".spinner" WaitUntilExist "#dashboard" CopyElement "#user-name" $NAME CopyPage CreateComment "Login successful for" $NAME

Send data to an API

#!AUTOMATE # Submit a form via a REST API with user input SetVal $API "https://api.example.com" Input $NAME "Your name:" Input $EMAIL "Your email:" Input $MESSAGE "Your message:" # Form mode: variables are replaced automatically WPost $RES "$API/contact" "name=$NAME" "email=$EMAIL" "message=$MESSAGE" Alert "API response:" $RES # JSON mode: variables are replaced inside the string SetVal $ACTION "signup" WPost $RES2 "$API/users" '{"action":"$ACTION","name":"$NAME","email":"$EMAIL"}' Alert "JSON response:" $RES2

Limits to be aware of

  • Input uses the browser's prompt box: avoid it in a Firefox tab in kiosk mode.
  • Wget and WPost follow the browser's CORS rules: some external APIs may reject the request.
  • LoadUrl waits for the page to load, not necessarily for asynchronous scripts to finish: add a Sleep or a WaitUntilExist if needed.
  • A script is limited to 2,000 instructions per run, to prevent infinite loops.
  • The Recorder produces linear scripts: conditions (If, labels) are added by hand.
  • CopyPage (attachment) and CreateComment require a saved note.

→ Go further: automatic audit macros

Convinced? Get started.

Install the extension, create a note and write #!AUTOMATE: your first test runs within minutes.

1Install the extensionChrome, Firefox or Edge
2Record your journeyWith a note's ⏺ button