Selenium Browse

Selenium Browse

Certified

Automate a browser session

Opens a single WebDriver session against a Selenium Grid, executes a list of actions sequentially, then closes the session. Supports navigation, clicking, typing, waiting for elements, extracting text, taking screenshots, running JavaScript, and downloading files via Selenium Grid managed downloads.

yaml
type: io.kestra.plugin.selenium.Browse

Navigate to example.com and extract the heading text.

yaml
id: selenium_browse
namespace: company.team

tasks:
  - id: browse
    type: io.kestra.plugin.selenium.Browse
    remoteUrl: "{{ secret('SELENIUM_GRID_URL') }}"
    actions:
      - action: NAVIGATE
        url: "https://example.com"
      - action: EXTRACT_TEXT
        id: heading
        selector: "h1"
      - action: SCREENSHOT
        name: "result.png"

Download a file by clicking a link and storing it in Kestra internal storage.

yaml
id: selenium_download
namespace: company.team

tasks:
  - id: browse
    type: io.kestra.plugin.selenium.Browse
    remoteUrl: "{{ secret('SELENIUM_GRID_URL') }}"
    actions:
      - action: NAVIGATE
        url: "https://the-internet.herokuapp.com/download"
      - action: WAIT_FOR
        selector: ".example a"
      - action: DOWNLOAD
        selector: ".example a:first-of-type"
Properties
Min items1

Actions

Ordered list of browser actions to execute within a single session.

Definitions
action*string
Possible Values
NAVIGATECLICKTYPEWAIT_FOREXTRACT_TEXTSCREENSHOTEXECUTE_SCRIPTDOWNLOAD

Action type

The browser action to perform. One of: NAVIGATE (go to a URL), CLICK (click an element by CSS selector), TYPE (type text into an element), WAIT_FOR (wait until an element is present), EXTRACT_TEXT (read text from element(s)), SCREENSHOT (capture the viewport), EXECUTE_SCRIPT (run JavaScript and capture the return value), DOWNLOAD (fetch files from the Selenium Grid node into Kestra internal storage; if selector is set, waits for it to be clickable and clicks it to trigger the download; trigger downloads through this selector, not a separate CLICK action; requires the Grid node to have managed downloads enabled, SE_NODE_ENABLE_MANAGED_DOWNLOADS=true).

clearbooleanstring

Clear before typing

When true, TYPE clears the element's existing value before sending keys. Defaults to false.

conditionstring
Possible Values
PRESENTVISIBLECLICKABLE

Wait condition

Element state to wait for in WAIT_FOR: PRESENT (exists in the DOM), VISIBLE (also displayed), or CLICKABLE (visible and enabled). Defaults to PRESENT.

idstring

Output key

Key under which EXTRACT_TEXT or EXECUTE_SCRIPT results are stored in the output.

multiplebooleanstring

Multiple

When true, EXTRACT_TEXT returns a list of texts from all matching elements. Defaults to false.

namestring

Screenshot filename

Output filename for SCREENSHOT. Defaults to screenshot_.png.

scriptstring

JavaScript

Script body for EXECUTE_SCRIPT. The return value is captured in the output.

selectorstring

CSS selector

CSS selector for CLICK, TYPE, WAIT_FOR, EXTRACT_TEXT, and DOWNLOAD.

urlstring

URL

Target URL for NAVIGATE.

valuestring

Value

Text to type into the element for TYPE.

waitTimeoutstring

Wait timeout

Maximum time to wait for the target element or file. Applies to CLICK and TYPE (element clickable, default PT10S), WAIT_FOR (default PT10S), EXTRACT_TEXT (element visible when multiple is false, presence of at least one element when true, default PT10S), and DOWNLOAD (its own selector's element clickable, then the new stable file, both using the same value, default PT30S).

Selenium Grid or WebDriver endpoint

URL of the remote WebDriver, e.g. http://localhost: 4444.

Security note: the Grid node will open any URL passed to a NAVIGATE action, including addresses reachable only from the Grid host's network (internal services, cloud metadata endpoints, etc.). Restrict Grid egress with network policy when running in shared or multi-tenant environments.

Possible Values
CHROMEFIREFOXEDGE

Browser

Browser to use. One of CHROME, FIREFOX, EDGE. Defaults to CHROME.

Extra capabilities

Additional browser capabilities merged into the options before the session is created. Values are passed unvalidated to the browser and Grid; only set these from trusted sources.

Headless

Run browser without a display. Defaults to true.

Default1048576

Maximum output size

Upper bound, in bytes, on the combined JSON-serialized size of extracted and scriptResults accumulated so far. Checked after each EXTRACT_TEXT and EXECUTE_SCRIPT action; exceeding it fails the task instead of growing the output further. Defaults to 1048576 (1 MB). Use SCREENSHOT or a narrower selector to capture large content instead, or raise this value if larger output is expected.

Page load timeout

Maximum time to wait for a page to load. Defaults to PT30S.

Grid password

Password for HTTP basic auth against the Grid endpoint, if required. Must be set together with username.

Grid username

Username for HTTP basic auth against the Grid endpoint, if required. Must be set together with password.

SubTypestring
Default{}

Downloads

Internal storage URIs of files fetched by DOWNLOAD actions, keyed by the original filename.

Default{}

Extracted texts

Text values captured by EXTRACT_TEXT actions, keyed by id or extract_.

SubTypestring
Default{}

Screenshots

Internal storage URIs of screenshots, keyed by filename.

Default{}

Script results

Return values from EXECUTE_SCRIPT actions, keyed by id or script_.