How-to

Wait for selector (waitForSelector)

Wait for selector (waitForSelector)

Waits until Target appears in the DOM/page. Prefer this over a fixed waitForTimeout pause.

Step model

action_namewaitForSelector
GroupWait
TargetRequired
ValueUnused
expected_valueUnused
TEST_ACCOUNTForbidden
Do not confuse withtoBeVisible, waitForTimeout

Target/Value facts match the source-of-truth catalog and Autotest step.

Prerequisites

  1. You know a stable locator for the expected element.

Steps

  1. Add a waitForSelector step.
  2. Set Target.
  3. Optionally set timeout_ms.
  4. Save.

The step is stored on the autotest. Next - neighbouring steps or autotest run creation.

Examples

Wait for the results table

Fields in the UI:

FieldValue
action_namewaitForSelector
Targetkind TESTID, value results-table
timeout_ms15000

Step JSON fragment (copy-paste):

json
{
  "action_name": "waitForSelector",
  "target": {
    "kind": "TESTID",
    "value": "results-table"
  },
  "timeout_ms": 15000
}

Common mistakes

  • Do not use a long waitForTimeout «just in case» instead of waiting for a selector.
  • To assert visibility after appearance, prefer toBeVisible.

Screenshots

Screenshots of the step form for waitForSelector will be added here in a later pass.

Version 1.0.0 · Last updated 2026-09-11

Did this page help?