protractor XPath selectors in Protractor Selecting a DOM element using protractor


Example

Apart from CSS, model, and binding selectors, protractor can also locate elements using xpath View

<ul>
<li><a href='http://www.google.com'>Go to google</a></li>
</ul>

Code

var googleLink= element(by.xpath('//ul/li/a'));
expect(element.getText()).to.eventually.equal('Go to google','The text you mention was not found');