lundi 7 novembre 2016

Locate element by custom attribute

How do you locate all those elements that has particular custom attribute in Protractor? I found similar questions on Stackoverflow and on net, but they uses xpath which puts restriction on tag.

element(by.xpath('//div[@custom-attribute]'))

As oppose to above example, I don't want to put restriction on tag since we have different tags with the same custom attribute. I'd like locate all elements with the attribute regardless of tag. Is that possible?

Aucun commentaire:

Enregistrer un commentaire