Using the engine

Engine v2.0.2 Windows · macOS · Linux

Everything you need to install TWRAR, record a page, save it as a profile, and replay it whenever you need to.

Installation

TWRAR requires Python 3.10+.

  1. 1

    Clone the repo

    git clone https://github.com/TWRAR/Engine.git
    cd Engine
  2. 2

    Install dependencies

    pip install -r requirements.txt
    playwright install chromium

    playwright install chromium is only needed if you don't set browser.executable_path and leave the default browser detection to launch Playwright's own Chromium instead of your machine's installed browser.

  3. 3

    Launch

    python gui_main.py

    Prefer not to install Python at all? Grab a standalone executable instead from the Releases page.

The GUI

python gui_main.py opens the recorder/editor window. Fill in a Start URL and browser, then work through recording, editing, and playing back a profile.

Record

Fill in Start URL and Browser, click Start Browser, then ● Record. Click, type, and navigate the real page as normal — every interaction appears as a step in the list on the left. Click ● Record again to stop.

Edit steps

Reorder, edit (selector/value/timeout), or delete any step. Add Action inserts a step type the recorder can't capture by hand — assert, sleep, scrape, evaluate, click_coords, and more. Select a run of steps and Group into Macro to make them reusable.

Save & play

Save Config writes everything to a YAML profile you can reopen with Load Config. ▶ Play replays the current steps right there in the GUI, with ⏸ Pause/⏹ Stop controlling a run in progress.

Reports

Set a Report dir on the config bar to get a pass/fail/continued report.html/report.json after each run, with per-step timings and a screenshot auto-captured for any step that failed.

Config shape

A profile is one YAML file: a list of steps and optional named macros.

Steps & macros

steps is the sequence that runs when the script starts. Any step can set retry: {times, delay_ms} or continue_on_error: true. macros are named step lists invoked with {action: run_macro, name: <key>}.

Output

output.results_file dumps scrape/ evaluate values as JSON. output.report_dir writes the pass/fail HTML/JSON report described above.

Validation (unknown actions, missing required fields, dangling run_macro references) runs automatically before every Play, so a typo fails immediately instead of mid-run. See twrar/actions.py for the full, authoritative action registry, or the README for the complete config reference.