According to the documentation, to get a single attribute by name you can use .getAttribute()
on a WebElement
:
var myElement = element(by.id('myId'));
expect(myElement.getAttribute('myAttr')).toEqual('myValue');
But how can I get all of the attributes that an element has?
There is no information about this use case/functionality in the Protractor API.
See Question&Answers more detail:os