Back to Docs
Interaction

wait

Wait for an element to appear in the DOM. Uses MutationObserver for efficient detection.

Usage

$ cdpilot wait <selector> [<timeout>]

Arguments

NameRequiredDescription
selectorrequiredCSS selector to wait for
timeoutoptionalTimeout in seconds (default: 5)

Examples

Wait up to 5 seconds for a modal to appear

$ npx cdpilot wait ".modal-content"

Wait up to 10 seconds for results

$ npx cdpilot wait "#results" 10