Cloning element finders Cloning element finders selenium selenium

Cloning element finders


Clone was introduced here: https://github.com/angular/protractor/issues/1303.And honestly now I think about it, it was a mistake to introduce it, as it offers no practical values.

Originally, there was fear that subsequent chains of elementFinders would affect previous ones:

var outerElement = element(by.abc...).all(by.def...).first().element(by.ghi...);var outerText = outerElement.getText();var innerElement = innerElement.element(by.xyz...);// Now that I chained more things onto outerElement, is the original outerElement still behaving the same as before? (i.e. is outerText the same as outerElement.getText() still)