---
name: convert-recorded-browser-sessions-into-automation-code
description: "Converts recorded browser sessions into deterministic automation code. Use when a raw interaction trace must become a reliable, validated browser script with stable selectors and retry handling."
license: CC-BY-4.0
compatibility: "Needs access to: Browser, Terminal, GitHub."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-15"
  source: "https://botbento.com/usecases/convert-recorded-browser-sessions-into-automation-code/"
  kind: workflow
  hermes:
    tags: ["automation", "browser", "playwright", "testing", "scripting"]
    category: coding
    requires_toolsets: ["browser", "terminal"]
---
# Convert recorded browser sessions into automation code

Transform interactive web demonstration logs into reliable browser automation scripts.

## When to use

Turn recorded web interactions into clean, deterministic browser scripts. The bot analyzes raw clicks, navigation events, and form inputs, chooses stable element selectors, and writes versioned automation tests with retry policies.

## Inputs

- `session_trace`: Recorded clicks, navigation events, and form inputs from the interactive web session.
- `target_web_page`: The web page or site that the recorded browser session interacted with.
- `target_repository`: Repository where the generated automation code and pull request should be submitted.

## Steps

1. When something happens: New session trace submitted (A new session trace is submitted.)
2. Generate deterministic script
3. Pull request with automation code

## Instructions

Inspect the submitted interaction trace and target web page. Construct an end-to-end browser automation script using stable selectors rather than fragile positional coordinates. Add logging, retry logic, and fallback handlers for dynamic elements. Run a validation test in a headless browser to ensure the script passes before opening a branch. Wait for user approval before submitting a pull request to the repository or committing code.

## Approvals

- Submitting a pull request to the repository must wait for user approval.
- Committing automation code must wait for user approval.

## Output

Pull request containing a versioned browser automation script with stable selectors, logging, retry logic, fallback handlers, and validation test results. (format: pull_request)

## Source

Summarized in our own words from [Show HN: Build Web Automations via Demonstration](https://news.ycombinator.com/item?id=46779864) (Hacker News, checked 2026-10-15). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/convert-recorded-browser-sessions-into-automation-code/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
