isEqual
Return true if the selected element matches with the provided one.
Usage
$(selector).isEqual(el)
Parameters
Name | Type | Details |
---|---|---|
el | Element | element to compare with |
Example
- Asynchronous Mode
- Synchronous Mode
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
});
isEqual.js
it('should detect if an element is clickable', () => {
const el = $('#el')
const sameEl = $('#el')
const anotherEl = $('#anotherEl')
el.isEqual(sameEl) // outputs: true
el.isEqual(anotherEl) // outputs: false
});
caution
Synchronous Mode will depcrecated with Node.js v16. With an update to the underlying Chromium version it became technically impossible to provide the same synchronous behavior. We recommend to start transition to asynchronous command execution. For more information, see our RFC.