Runs onWrit CloudDesktopSelf-hosted
On this page
Assert
The assert step checks that an element is on the page and, when you give it an expected value, that the element says what it should. If the check does not hold the run fails with the difference spelled out — so a workflow that quietly stopped working reports itself instead of returning empty results.
In a workflow, this is a step object with "type": "assert". Steps run in order, and each step can read the outputs of the steps before it. See the full workflows reference for the 30+ step types.
Writ runs on your own accounts, with your own credentials and data, on sites you are authorized to use.
Fields
| Field | Type | Description |
|---|---|---|
selector required | selector | The element the assertion inspects. |
value | string | The expected text or field value. Omit it to assert only that the element exists. Placeholders resolve at run time: {{key}} from the workflow’s declared inputs, {{vault:name}} for secrets. |
match | string | "contains" (default) or "exact". Both compare with surrounding whitespace collapsed. |
Example
A single assert step as it appears in a workflow's steps array:
{
"type": "assert",
"config": { "selector": ".order-status", "value": "Confirmed" }
} How it behaves
- The element is awaited for the step timeout before the assertion is judged, so it tolerates content that is still rendering.
- Text and field value are both checked, so one step covers a
<span>and an<input>without you choosing which. - An expected value built from a secret is never echoed back in the failure message.
Where it runs
The assert step executes wherever the run executes. On your local or BYO agent there is no compute charge and the agent can reach intranet-only systems; on Writ cloud the run is metered by running time (~$0.12 per browser-hour, from your plan’s included usage wallet.
What next
- Workflows - the full step vocabulary and the workflow object.
- Recorder - capture steps by clicking through a site.
- Managed endpoints - turn the workflow into a REST endpoint, or an MCP tool.