Skip to content

Variables

lotus64 edited this page Jun 17, 2026 · 1 revision

Variables

Volt provides a simple but powerful templating engine to use variables throughout your scripts.

Defining Variables

You can define initial variables in the vars section of your script:

vars:
  search_term: "playwright automation"
  base_url: "https://google.com"

Using Variables

To use a variable in a step, wrap its name in double curly braces {{var_name}}:

steps:
  - action: navigate
    url: "{{base_url}}"
  - action: type
    selector: "input[name='q']"
    value: "{{search_term}}"

State Variables

Variables can also be set dynamically during execution using specific actions like store_value, store_text, store_attribute, or store_eval.

steps:
  - action: store_text
    name: "page_title"
    selector: "h1"
  - action: log
    message: "The title is {{page_title}}"

Clone this wiki locally