Zum Hauptinhalt springen

isEqual

Gibt true zurück, wenn das ausgewählte Element mit dem bereitgestellten Element übereinstimmt.

Verwendung
$(selector).isEqual(el)
Parameter
NameTypeDetails
elElementElement zum Vergleichen
Beispiel
isEqual.js
it('should detect if an element is clickable', async () => {
const el = await $('#el')
const sameEl = await $('#el')
const anotherEl = await $('#anotherEl')

el.isEqual(sameEl) // outputs: true

el.isEqual(anotherEl) // outputs: false
});
Rückgabewert
  • <Boolean> return: true wenn Elemente gleich sind

Welcome! How can I help?

WebdriverIO AI Copilot