Recently, a new method called equals()
was introduced in the latest version of Protractor for an ElementFinder
object. This method essentially utilizes the WebElement.equals()
function from WebDriverJS:
return webdriver.WebElement.equals(this.getWebElement(),
element.getWebElement ? element.getWebElement() : element);
But how exactly does the equals()
method determine if elements are equal? Merely comparing the innerHTML
wouldn't suffice as two distinct elements could look identical on a page.