Skip to content

Automation Cheatsheet

Here’s a cheatsheet—a quick overview and reference—for the Webfuse Automation API.

Hierarchical diagram of Webfuse APIs and the Automation API
// DOM-based
await browser.webfuseSession
.automation
.see
.domSnapshot()
// Vision-based
await browser.webfuseSession
.automation
.see
.guiSnapshot()
// DOM-based (by CSS selector)
await browser.webfuseSession
.automation
.act
.click("button#submit")
// Vision-based (by point coordinate)
await browser.webfuseSession
.automation
.act
.click([374, 1020])
// DOM-based
const snapshot = await browser.webfuseSession
.automation
.see
.domSnapshot()
const snapshot32KTokens = await browser.webfuseSession
.tool
.downsample(snapshot);

Downsampling is a technique to ‘compress’ a DOM snapshot:

<section class="container" tabindex="3" required="true" type="example">
<div class="mx-auto" data-topic="products" required="false">
<h1>Our Pizza</h1>
<div>
<div class="shadow-lg">
<h2>Margherita</h2>
<p>
A simple classic: mozzarela, tomatoes and basil.
An everyday choice!
</p>
<button type="button">Add</button>
</div>
<div class="shadow-lg">
<h2>Capricciosa</h2>
<p>
A rich taste: mozzarella, ham, mushrooms, artichokes, and olives.
A true favourite!
</p>
<button type="button">Add</button>
</div>
</div>
</div>
</section>

…could be downsampled to:

<section tabindex="3" class="container" required="true">
# Our Pizza
<div class="shadow-lg">
## Margherita
A simple classic mozzarela tomatoes and basil
<button type="button">Add</button>
## Capricciosa
A rich taste A true favourite
<button type="button">Add</button>
</div>
</section>
WebfusePlaywrightPuppeteer
Human-like (natural) pointer✔️
Human-like (natural) typing✔️✔️✔️
Cross-frame targeting✔️
Cross-shadow targeting✔️ManualManual
GUI snapshots✔️✔️✔️
DOM snapshots✔️✔️✔️
DOM downsampling✔️
Accessibility tree✔️Partial
LLM-based agents focus✔️
Remote browser✔️✔️
Embedded/user browser✔️StreamStream
MCP-ready✔️SeparateSeparate