Test if two web element IDs refer to the same DOM element.

This command is deprecated and is only available on the JSON Wire protocol

For more info on working with DOM elements in Nightwatch, refer to the Finding & interacting with DOM Elements guide page.

Please note that this command operates on a protocol level and accepts the Web Element ID as the parameter. To retrieve it, use either the .findElement() or .findElements() command. Read more on Element retrieval.

Usage

Example

module.exports = {
 'demo Test' : function(browser) {
    browser.elementIdEquals('<ID-1>', '<ID-2>', function(result) {
      console.log(result.value)
    });
  }
}

Parameters

Name Type description
webElementId string

The Web Element ID of the element to route the command to.

otherId string

The Web Element ID of the other element to compare against.

callback function

Callback function which is called with the result value.

W3C WebDriver spec