Skip to main content
Use assert_locator_node to check whether a specific element is present on the page and store the result. It evaluates a Playwright locator within a timeout and writes a boolean into output_variable_name (true if the assertion passes, false if it does not). You then branch on that variable with an if_else_node. This is the lowest-overhead way to capture element presence—no LLM call, no extraction step, just a direct visibility check that becomes a reusable variable.

Structure

The node above stores error_visible = [true] or error_visible = [false]. Reference it later as {error_visible[0]}.

Properties

The result is stored as a single-element list, matching the convention used by other variables, so you reference it with index [0] (e.g. {error_visible[0]}).

Assertions

If the assertion does not pass within timeout, the variable is set to false (no error is raised). If the locator does not resolve at all, the result is also false.

Examples

Dismiss an element only when it appears

Check whether an error alert is visible, then dismiss it with a following if_else_node:

Wait for a spinner to disappear, then branch

Wait up to 10 seconds for a loading spinner to be hidden, then submit or fail:

Variable substitution in the locator

locator supports {variable[index]} substitution, so you can target elements dynamically:

assert_locator_node vs if_else_node

assert_locator_node produces the boolean; if_else_node consumes it. Pair them to run steps conditionally on element presence, or use the variable in any later condition.

Locator Syntax

The locator field uses the same Playwright command syntax as interaction actions—omit the leading page.:
For full locator syntax guidance see Locators.