Utility Commands
Utility commands provide a wide range of helper functions for your automations: adding comments, taking screenshots, saving PDFs, running scripts, manipulating files, and auditing web pages. These commands don’t interact with page elements directly but provide essential support functionality.
comment
Section titled “comment”Adds a descriptive comment to the automation logs. Comments don’t perform any action — they simply add a note to the logs so you can understand what your automation is doing.
Description
Section titled “Description”The comment command adds a text note to the automation logs. It doesn’t perform any action on the page. Comments are useful for documenting your automation logic, especially in complex workflows.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
text |
string | ✅ Yes | "" |
The comment text to add to the logs. |
Example
Section titled “Example”{ "command": "comment", "params": { "text": "Now extracting product data from the listing page" }}Behavior Notes
Section titled “Behavior Notes”- Comments appear in the Execution Logs with the
INFOlevel. - Comments don’t affect the automation’s execution in any way.
- Use comments to document complex logic, especially in long automations.
save_as_pdf
Section titled “save_as_pdf”Saves the current page as a PDF file.
Description
Section titled “Description”The save_as_pdf command saves the current page as a PDF file. This is useful for archiving web pages, generating reports, or creating printable versions of web content.
This command runs on the server side and is not available in the browser extension’s preview mode.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path |
string | ✅ Yes | "page.pdf" |
The file path where the PDF will be saved. |
options |
object | No | {} |
Additional PDF options (e.g., page size, margins). |
Example
Section titled “Example”{ "command": "save_as_pdf", "params": { "path": "reports/monthly_report.pdf" }}Behavior Notes
Section titled “Behavior Notes”- The PDF is saved to the RTILA output directory.
- The
pathparameter is relative to the output directory. - The
optionsparameter accepts standard PDF options likeformat,margin,landscape, etc. - This command is not available in the browser extension’s preview mode.
screenshot
Section titled “screenshot”Takes a screenshot of the page.
Description
Section titled “Description”The screenshot command captures a screenshot of the current page and saves it as an image file. This is useful for visual verification, debugging, or archiving.
This command runs on the server side and is not available in the browser extension’s preview mode.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path |
string | ✅ Yes | "screenshot.png" |
The file path where the screenshot will be saved. |
fullPage |
boolean | No | true |
If true, captures the entire page (including content below the fold). If false, captures only the visible viewport. |
Example
Section titled “Example”{ "command": "screenshot", "params": { "path": "screenshots/product_page.png", "fullPage": true }}Behavior Notes
Section titled “Behavior Notes”- The screenshot is saved to the RTILA output directory.
- The
pathparameter is relative to the output directory. - If
fullPageistrue, the screenshot includes the entire page, even content below the visible viewport. - If
fullPageisfalse, only the visible viewport is captured. - This command is not available in the browser extension’s preview mode.
set_viewport_size
Section titled “set_viewport_size”Sets the browser’s viewport to a specific width and height.
Description
Section titled “Description”The set_viewport_size command changes the browser’s viewport size. This is useful for testing responsive designs, capturing screenshots at specific sizes, or simulating different device sizes.
This command runs on the server side and is not available in the browser extension’s preview mode.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
width |
number | ✅ Yes | 1280 |
The viewport width in pixels. |
height |
number | ✅ Yes | 720 |
The viewport height in pixels. |
Example
Section titled “Example”{ "command": "set_viewport_size", "params": { "width": 1920, "height": 1080 }}Behavior Notes
Section titled “Behavior Notes”- The viewport size affects how the page is rendered. Some websites use responsive design and may display differently at different viewport sizes.
- This command is useful for testing responsive designs or capturing screenshots at specific sizes.
- This command is not available in the browser extension’s preview mode.
set_geolocation
Section titled “set_geolocation”Sets the browser’s geographic location.
Description
Section titled “Description”The set_geolocation command sets the browser’s geographic location. This is useful for testing location-based features or simulating access from different locations.
This command runs on the server side and is not available in the browser extension’s preview mode.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
latitude |
number | ✅ Yes | 0 |
The latitude coordinate. |
longitude |
number | ✅ Yes | 0 |
The longitude coordinate. |
Example
Section titled “Example”{ "command": "set_geolocation", "params": { "latitude": 40.7128, "longitude": -74.0060 }}Behavior Notes
Section titled “Behavior Notes”- The geolocation is set for the browser context. All pages in the context will report this location.
- This command is useful for testing location-based features or simulating access from different locations.
- This command is not available in the browser extension’s preview mode.
context_set_offline
Section titled “context_set_offline”Simulates the browser being offline.
Description
Section titled “Description”The context_set_offline command simulates the browser being offline. This is useful for testing how your automation handles network failures or for testing offline functionality.
This command runs on the server side and is not available in the browser extension’s preview mode.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
offline |
boolean | No | true |
If true, simulates the browser being offline. If false, restores normal network access. |
Example
Section titled “Example”{ "command": "context_set_offline", "params": { "offline": true }}Behavior Notes
Section titled “Behavior Notes”- When
offlineistrue, all network requests will fail. - Set
offlinetofalseto restore normal network access. - This command is useful for testing how your automation handles network failures.
- This command is not available in the browser extension’s preview mode.
clear_cookies
Section titled “clear_cookies”Clears all cookies for the current site.
Description
Section titled “Description”The clear_cookies command clears all cookies for the current site. This is useful for testing how your automation behaves with a clean session, or for logging out of a website.
Parameters
Section titled “Parameters”This command has no parameters.
Example
Section titled “Example”{ "command": "clear_cookies", "params": {}}Behavior Notes
Section titled “Behavior Notes”- This command clears all cookies for the current site.
- This is useful for testing how your automation behaves with a clean session.
- This command is available in both the browser extension and the server-side engine.
execute_script
Section titled “execute_script”Runs a snippet of JavaScript on the page and can store the result in a variable.
Description
Section titled “Description”The execute_script command runs a snippet of JavaScript in the browser page context. The script has access to the DOM and can manipulate page elements. The result of the script can be stored in a variable for use in later commands.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
script |
string | ✅ Yes | "" |
The JavaScript code to execute. The code runs in the browser page context. |
output_variable |
string | No | "" |
The name of the variable to store the script’s return value in. |
Example
Section titled “Example”{ "command": "execute_script", "params": { "script": "return document.title;", "output_variable": "page_title" }}Get all links on the page:
{ "command": "execute_script", "params": { "script": "return Array.from(document.querySelectorAll('a')).map(a => a.href);", "output_variable": "all_links" }}Behavior Notes
Section titled “Behavior Notes”- The script runs in the browser page context, so it has access to the DOM.
- The script can use
document,window, and other browser APIs. - The script’s return value is stored in the
output_variableif specified. - This command is available in both the browser extension and the server-side engine.
run_script
Section titled “run_script”Runs a snippet of JavaScript that can access and modify state variables.
Description
Section titled “Description”The run_script command runs a snippet of JavaScript in the Deno engine (server-side). The script has access to the automation state, including variables, memory, and page context. This is the most powerful command for custom logic.
This command runs on the server side and is not available in the browser extension’s preview mode.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
script |
string | ✅ Yes | "" |
The JavaScript code to execute. The code runs in the Deno engine. |
Example
Section titled “Example”{ "command": "run_script", "params": { "script": "const price = parseFloat(state.variables.price); const discounted = price * 0.9; state.variables.discounted_price = discounted.toFixed(2);" }}Behavior Notes
Section titled “Behavior Notes”- The script runs in the Deno engine, not in the browser.
- The script has access to
state.variables,state.memory,page,context, andhelpers. - The
helpersobject provides helper functions likesleep,waitForElement, etc. - This command is not available in the browser extension’s preview mode.
- Use
run_scriptfor complex logic that can’t be expressed with other commands.
process_image
Section titled “process_image”Manipulates an image file (resize, crop, convert).
Description
Section titled “Description”The process_image command manipulates an image file. It can resize, crop, convert, or compress images. This is useful for processing images downloaded during scraping.
This command runs on the server side and is not available in the browser extension’s preview mode.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
input_path |
string | ✅ Yes | "" |
The path to the input image file. |
output_path |
string | ✅ Yes | "" |
The path where the processed image will be saved. |
action |
string | ✅ Yes | "resize" |
The action to perform. Options: resize, crop, convert, compress. |
options |
object | No | {} |
Action-specific options. |
Action Options
Section titled “Action Options”| Action | Options | Description |
|---|---|---|
resize |
width, height |
Resize the image to the specified dimensions. |
crop |
x, y, width, height |
Crop the image to the specified region. |
convert |
format, quality |
Convert the image to a different format (e.g., JPEG, PNG). |
compress |
quality |
Compress the image to reduce file size. |
Example
Section titled “Example”{ "command": "process_image", "params": { "input_path": "downloads/product_image.jpg", "output_path": "processed/product_image_resized.jpg", "action": "resize", "options": { "width": 800, "height": 600 } }}Behavior Notes
Section titled “Behavior Notes”- The input and output paths are relative to the RTILA output directory.
- The
optionsparameter depends on theactionbeing performed. - This command is not available in the browser extension’s preview mode.
file_operation
Section titled “file_operation”Performs file system operations in the output directory.
Description
Section titled “Description”The file_operation command performs file system operations like moving, renaming, copying, deleting, zipping, and unzipping files. This is useful for organizing output files or preparing files for upload.
This command runs on the server side and is not available in the browser extension’s preview mode.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
action |
string | ✅ Yes | "move" |
The action to perform. Options: move, rename, copy, delete, zip, unzip. |
source |
string | ✅ Yes | "" |
The source file or directory path. |
destination |
string | ✅ Yes | "" |
The destination path (for move, rename, copy, zip, unzip). |
Example
Section titled “Example”{ "command": "file_operation", "params": { "action": "move", "source": "downloads/report.csv", "destination": "reports/monthly/report.csv" }}Behavior Notes
Section titled “Behavior Notes”- The source and destination paths are relative to the RTILA output directory.
- The
zipaction creates a ZIP archive of the source file or directory. - The
unzipaction extracts a ZIP archive to the destination directory. - This command is not available in the browser extension’s preview mode.
audit_accessibility
Section titled “audit_accessibility”Runs an accessibility audit (e.g., axe-core) on the current page.
Description
Section titled “Description”The audit_accessibility command runs an accessibility audit on the current page using axe-core. It identifies accessibility issues like missing alt text, insufficient color contrast, and missing form labels.
This command runs on the server side and is not available in the browser extension’s preview mode.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
scope |
string | No | "html" |
The CSS selector for the scope of the audit. |
rules |
array | No | [] |
Specific accessibility rules to check. If empty, all rules are checked. |
output_variable |
string | No | "a11y_report" |
The name of the variable to store the audit report in. |
output_filename |
string | No | "accessibility_report.json" |
The file path where the audit report will be saved. |
Example
Section titled “Example”{ "command": "audit_accessibility", "params": { "scope": "main", "output_variable": "a11y_report", "output_filename": "reports/accessibility_report.json" }}Behavior Notes
Section titled “Behavior Notes”- The audit uses axe-core, a popular accessibility testing library.
- The
scopeparameter limits the audit to a specific part of the page. - The audit report is saved to the specified file and stored in the specified variable.
- This command is not available in the browser extension’s preview mode.
detect_tech_stack
Section titled “detect_tech_stack”Detects technologies used on the current page.
Description
Section titled “Description”The detect_tech_stack command detects the technologies used on the current page. It identifies frameworks, libraries, and other technologies like React, Vue, Angular, WordPress, etc.
This command runs on the server side and is not available in the browser extension’s preview mode.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
output_variable |
string | No | "tech_stack" |
The name of the variable to store the detected technologies in. |
Example
Section titled “Example”{ "command": "detect_tech_stack", "params": { "output_variable": "tech_stack" }}Behavior Notes
Section titled “Behavior Notes”- The command detects common web technologies like React, Vue, Angular, WordPress, jQuery, etc.
- The detected technologies are stored in the specified variable as an array of strings.
- This command is not available in the browser extension’s preview mode.
audit_links
Section titled “audit_links”Scans the page for links and checks their HTTP status.
Description
Section titled “Description”The audit_links command scans the page for links and checks their HTTP status. It identifies broken links (404 errors), redirects, and other issues.
This command runs on the server side and is not available in the browser extension’s preview mode.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
string | No | "a[href]" |
The CSS selector for the links to check. |
concurrency |
number | No | 5 |
Number of links to check simultaneously. |
timeout |
number | No | 10000 |
Timeout for each link check, in milliseconds. |
output_filename |
string | No | "audit_report.json" |
The file path where the audit report will be saved. |
Example
Section titled “Example”{ "command": "audit_links", "params": { "selector": "a[href]", "concurrency": 10, "timeout": 15000, "output_filename": "reports/link_audit.json" }}Behavior Notes
Section titled “Behavior Notes”- The command checks each link’s HTTP status code.
- Links with status codes 400 or higher are flagged as broken.
- The audit report is saved to the specified file.
- The
concurrencyparameter controls how many links are checked simultaneously. Higher values are faster but may trigger rate limiting. - This command is not available in the browser extension’s preview mode.