Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.optexity.com/llms.txt

Use this file to discover all available pages before exploring further.

Interaction actions represent user interactions with the browser: clicking buttons, filling forms, navigating pages, and more.

Available Actions

ActionPurpose
click_elementClick buttons, links, elements
input_textType into text fields
select_optionSelect from dropdowns
checkCheck/uncheck checkboxes
upload_fileUpload files
go_to_urlNavigate to a URL
go_backGo back in history
close_tabs_untilClose tabs until condition met
download_url_as_pdfSave page as PDF
key_pressPress keyboard keys
agentic_taskAI agent for complex tasks
close_overlay_popupDismiss popups/modals

Common Properties

All element-targeting actions share these properties:
PropertyTypeDefaultDescription
commandstr | NoneNonePlaywright locator (e.g., get_by_role("button"))
xpathstr | NoneNoneXPath selector (alternative to command)
prompt_instructionsstrRequiredDescription for AI fallback
skip_promptboolFalseSkip AI if locator fails (for optional elements)
assert_locator_presenceboolFalseSkip action if element doesn’t exist
max_triesint10Maximum retry attempts
max_timeout_seconds_per_tryfloat1.0Timeout per attempt
Use command for deterministic element finding (fast, no LLM tokens). The AI uses prompt_instructions as fallback when locators fail.

Click Element

{
  "interaction_action": {
    "click_element": {
      "command": "get_by_role(\"button\", name=\"Submit\")",
      "prompt_instructions": "Click the submit button"
    }
  }
}

Click Properties

PropertyTypeDefaultDescription
double_clickboolFalseDouble-click instead of single
expect_downloadboolFalseClick triggers file download
download_filenamestr | NoneAuto-generatedFilename for download

Examples

Double-click:
{
  "click_element": {
    "command": "get_by_role(\"row\", name=\"Item 1\")",
    "double_click": true
  }
}
Download trigger:
{
  "click_element": {
    "command": "get_by_role(\"button\", name=\"Export\")",
    "expect_download": true,
    "download_filename": "report.pdf"
  }
}

Input Text

{
  "interaction_action": {
    "input_text": {
      "command": "get_by_label(\"Email\")",
      "input_text": "{email[0]}",
      "prompt_instructions": "Enter the email address"
    }
  }
}

Input Properties

PropertyTypeDefaultDescription
input_textstr | NoneNoneText to enter (supports variables)
fill_or_type"fill" | "type""fill"How to enter text
is_sliderboolFalseElement is a slider
press_enterboolFalsePress Enter after input

Fill vs Type

ModeBehaviorUse When
fillSets value instantlyStandard form fields
typeTypes character by characterAutocomplete, search with suggestions
Autocomplete example:
{
  "input_text": {
    "command": "get_by_label(\"Search\")",
    "input_text": "laptop",
    "fill_or_type": "type"
  }
}
Slider example:
{
  "input_text": {
    "command": "get_by_role(\"slider\", name=\"Price\")",
    "input_text": "500",
    "is_slider": true
  }
}
If input_text references an empty variable, the action is skipped automatically.

Select Option

{
  "interaction_action": {
    "select_option": {
      "command": "get_by_label(\"Country\")",
      "select_values": ["United States"],
      "prompt_instructions": "Select country"
    }
  }
}

Select Properties

PropertyTypeDefaultDescription
select_valueslist[str]RequiredValues to select
expect_downloadboolFalseSelection triggers download
download_filenamestr | NoneAuto-generatedFilename for download
Optexity supports fuzzy matching for select values—“United States” will match “UNITED STATES OF AMERICA”.

Check (Checkbox/Radio)

{
  "interaction_action": {
    "check": {
      "command": "get_by_label(\"I agree to the terms\")",
      "prompt_instructions": "Check the terms agreement"
    }
  }
}

Go to URL

PropertyTypeDefaultDescription
urlstrRequiredURL to navigate to
new_tabboolFalseOpen in new tab
{
  "interaction_action": {
    "go_to_url": {
      "url": "https://example.com/dashboard",
      "new_tab": true
    }
  }
}

Go Back

{
  "interaction_action": {
    "go_back": {}
  }
}

Close Tabs Until

Close tabs until reaching a specific URL or tab index:
PropertyTypeDefaultDescription
matching_urlstr | NoneNoneStop at this URL
tab_indexint | NoneNoneStop at this tab index (0-based)
{
  "interaction_action": {
    "close_tabs_until": {
      "matching_url": "https://example.com/dashboard"
    }
  }
}

File Operations

Upload File

The file source must be exactly one of file_path (local file) or file_url (public http(s):// URL — downloaded to a temp file just before upload, then cleaned up).
PropertyTypeDescription
file_pathstr | NoneAbsolute or relative local path
file_urlstr | NonePublic http:// or https:// URL; downloaded with a 120s timeout. If the download fails (network error or non-2xx response), the automation fails.
Upload from a local path:
{
  "interaction_action": {
    "upload_file": {
      "command": "get_by_label(\"Upload Document\")",
      "file_path": "/path/to/document.pdf",
      "prompt_instructions": "Upload the document"
    }
  }
}
Upload from a public URL:
{
  "interaction_action": {
    "upload_file": {
      "command": "get_by_label(\"Upload Document\")",
      "file_url": "https://example.com/files/document.pdf",
      "prompt_instructions": "Upload the document"
    }
  }
}

Download Page as PDF

Capture the current page or a specific URL as PDF:
PropertyTypeDefaultDescription
download_filenamestr | NoneAuto-generatedFilename for PDF
urlstr | NoneCurrent pageURL to download
{
  "interaction_action": {
    "download_url_as_pdf": {
      "download_filename": "page_snapshot.pdf"
    }
  }
}

Handling New Tabs

When an action opens a new tab, set expect_new_tab on the action node:
{
  "type": "action_node",
  "interaction_action": {
    "click_element": {
      "command": "get_by_role(\"button\", name=\"Open Details\")",
      "prompt_instructions": "Click to open in new tab"
    }
  },
  "expect_new_tab": true
}
This automatically waits up to 10 seconds for the new tab and switches to it.

Retry Configuration

For slow-loading elements, increase retry attempts:
{
  "interaction_action": {
    "max_tries": 15,
    "max_timeout_seconds_per_try": 2.0,
    "click_element": {
      "command": "get_by_role(\"button\", name=\"Submit\")",
      "prompt_instructions": "Click submit"
    }
  }
}
Increase max_tries rather than timeout per try. This finds elements faster when they appear while still allowing for slow pages.