Thanks to visit codestin.com
Credit goes to webdriver.io

Zum Hauptinhalt springen

waitForClickable

Warte auf ein Element für die angegebene Anzahl von Millisekunden, bis es anklickbar oder nicht anklickbar ist.

Info

Im Gegensatz zu anderen Element-Befehlen wartet WebdriverIO nicht darauf, dass das Element existiert, um diesen Befehl auszuführen.

Usage
$(selector).waitForClickable({ timeout, reverse, timeoutMsg, interval })
Parameters
NameTypeDetails
options
optional
WaitForOptionswaitForEnabled options (optional)
options.timeout
optional
NumberZeit in ms (Standardwert basierend auf waitforTimeout Konfigurationswert)
options.reverse
optional
Booleanwenn true, wartet es auf das Gegenteil (Standard: false)
options.timeoutMsg
optional
Stringwenn vorhanden, überschreibt es die Standard-Fehlermeldung
options.interval
optional
NumberIntervall zwischen Prüfungen (Standard: waitforInterval)
Example
waitForClickable.js
it('should detect when element is clickable', async () => {
const elem = await $('#elem')
await elem.waitForClickable({ timeout: 3000 });
});
it('should detect when element is no longer clickable', async () => {
const elem = await $('#elem')
await elem.waitForClickable({ reverse: true });
});
Returns
  • <Boolean> return: true wenn Element anklickbar ist (oder nicht, wenn Flag gesetzt ist)

Welcome! How can I help?

WebdriverIO AI Copilot