Skip to content

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.


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.

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.

Parameter Type Required Default Description
text string ✅ Yes "" The comment text to add to the logs.
{
"command": "comment",
"params": {
"text": "Now extracting product data from the listing page"
}
}
  • Comments appear in the Execution Logs with the INFO level.
  • Comments don’t affect the automation’s execution in any way.
  • Use comments to document complex logic, especially in long automations.

Saves the current page as a PDF file.

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.

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).
{
"command": "save_as_pdf",
"params": {
"path": "reports/monthly_report.pdf"
}
}
  • The PDF is saved to the RTILA output directory.
  • The path parameter is relative to the output directory.
  • The options parameter accepts standard PDF options like format, margin, landscape, etc.
  • This command is not available in the browser extension’s preview mode.

Takes a screenshot of the page.

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.

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.
{
"command": "screenshot",
"params": {
"path": "screenshots/product_page.png",
"fullPage": true
}
}
  • The screenshot is saved to the RTILA output directory.
  • The path parameter is relative to the output directory.
  • If fullPage is true, the screenshot includes the entire page, even content below the visible viewport.
  • If fullPage is false, only the visible viewport is captured.
  • This command is not available in the browser extension’s preview mode.

Sets the browser’s viewport to a specific width and height.

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.

Parameter Type Required Default Description
width number ✅ Yes 1280 The viewport width in pixels.
height number ✅ Yes 720 The viewport height in pixels.
{
"command": "set_viewport_size",
"params": {
"width": 1920,
"height": 1080
}
}
  • 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.

Sets the browser’s geographic location.

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.

Parameter Type Required Default Description
latitude number ✅ Yes 0 The latitude coordinate.
longitude number ✅ Yes 0 The longitude coordinate.
{
"command": "set_geolocation",
"params": {
"latitude": 40.7128,
"longitude": -74.0060
}
}
  • 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.

Simulates the browser being offline.

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.

Parameter Type Required Default Description
offline boolean No true If true, simulates the browser being offline. If false, restores normal network access.
{
"command": "context_set_offline",
"params": {
"offline": true
}
}
  • When offline is true, all network requests will fail.
  • Set offline to false to 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.

Clears all cookies for the current site.

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.

This command has no parameters.

{
"command": "clear_cookies",
"params": {}
}
  • 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.

Runs a snippet of JavaScript on the page and can store the result in a variable.

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.

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.
{
"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"
}
}
  • 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_variable if specified.
  • This command is available in both the browser extension and the server-side engine.

Runs a snippet of JavaScript that can access and modify state variables.

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.

Parameter Type Required Default Description
script string ✅ Yes "" The JavaScript code to execute. The code runs in the Deno engine.
{
"command": "run_script",
"params": {
"script": "const price = parseFloat(state.variables.price); const discounted = price * 0.9; state.variables.discounted_price = discounted.toFixed(2);"
}
}
  • The script runs in the Deno engine, not in the browser.
  • The script has access to state.variables, state.memory, page, context, and helpers.
  • The helpers object provides helper functions like sleep, waitForElement, etc.
  • This command is not available in the browser extension’s preview mode.
  • Use run_script for complex logic that can’t be expressed with other commands.

Manipulates an image file (resize, crop, convert).

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.

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 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.
{
"command": "process_image",
"params": {
"input_path": "downloads/product_image.jpg",
"output_path": "processed/product_image_resized.jpg",
"action": "resize",
"options": {
"width": 800,
"height": 600
}
}
}
  • The input and output paths are relative to the RTILA output directory.
  • The options parameter depends on the action being performed.
  • This command is not available in the browser extension’s preview mode.

Performs file system operations in the output directory.

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.

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).
{
"command": "file_operation",
"params": {
"action": "move",
"source": "downloads/report.csv",
"destination": "reports/monthly/report.csv"
}
}
  • The source and destination paths are relative to the RTILA output directory.
  • The zip action creates a ZIP archive of the source file or directory.
  • The unzip action extracts a ZIP archive to the destination directory.
  • This command is not available in the browser extension’s preview mode.

Runs an accessibility audit (e.g., axe-core) on the current page.

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.

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.
{
"command": "audit_accessibility",
"params": {
"scope": "main",
"output_variable": "a11y_report",
"output_filename": "reports/accessibility_report.json"
}
}
  • The audit uses axe-core, a popular accessibility testing library.
  • The scope parameter 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.

Detects technologies used on the current page.

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.

Parameter Type Required Default Description
output_variable string No "tech_stack" The name of the variable to store the detected technologies in.
{
"command": "detect_tech_stack",
"params": {
"output_variable": "tech_stack"
}
}
  • 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.

Scans the page for links and checks their HTTP status.

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.

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.
{
"command": "audit_links",
"params": {
"selector": "a[href]",
"concurrency": 10,
"timeout": 15000,
"output_filename": "reports/link_audit.json"
}
}
  • 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 concurrency parameter 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.