Skip to main content

waitForDisplayed

Wait for an element for the provided amount of milliseconds to be displayed or not displayed.

info

As opposed to other element commands WebdriverIO will not wait for the element to exist to execute this command.

Usage
$(selector).waitForDisplayed({ timeout, reverse, timeoutMsg, interval })
Parameters
NameTypeDetails
options
optional
WaitForOptionswaitForEnabled options (optional)
options.timeout
optional
Numbertime in ms (default: 500)
options.reverse
optional
Booleanif true it waits for the opposite (default: false)
options.timeoutMsg
optional
Stringif exists it overrides the default error message
options.interval
optional
Numberinterval between checks (default: waitforInterval)
Examples
index.html
loading...
waitForDisplayedExample.js
loading...

Welcome! How can I help?

WebdriverIO AI Copilot