ApplesauceOS
Read Markdown ↗Download .md

Element.waitForElement

Wait for a matching element. Scoped to descendants.

js
element.waitForElement(selector, optionsOrTimeout?)

Arguments

ArgumentTypeMeaning
selectorobject | stringAttribute filters; a string means {name: string}. See the UIHelper guide for selectors.
optionsOrTimeoutobject | numberOptional milliseconds, or {timeout:5000, interval:100, throwOnTimeout:true}. Interval is at least 10 ms.

Returns

Element; throws TimeoutError on timeout. With throwOnTimeout:false, returns null.

Example

js
const panel = UIHelper.waitForElement({id: "panel"}, 5000);
const field = panel.waitForElement({id: "search", visible: true, enabled: true}, 5000);
field.setText("Hello");

Notes

The parent must still be valid. See the matching UIHelper method for options. Placeholder panel/child identifiers require inspection.

All JavaScript APIs · Automation playbook