I am using Selenium WebDriver and Protractor to run e2e tests on my angular project. Let\'s say I have an element like:
try using:
element(by.css('[my-unique-id="abc123"]'))
it's easier and more readable than xpath for simple cases.
more about xpath syntax and when it is usefull: http://www.w3schools.com/xml/xml_xpath.asp
Try to use xpath:
element(by.xpath('//div[@my-unique-id="abc123"]'))
or only by attribute
element(by.xpath('//div[@my-unique-id]'))