<ul class="menu">
<li ui-sref-active="active">
<a class="ng-scope" translate="menu.home" href="#/home">Home</a>
</li>
<li ui-sref-active="active">
<a class="ng-scope" ui-sref="customer.list" translate="menu.customers" href="#/customers">Customers</a>
</li>
</ul>
To locate the element containing the text "Home" and using another attribute like translate
, you can use a combination of methods as shown below:
element(by.css("[translate='menu.home']:contains('Home')")).click();
This way, you are specifying both the translate
attribute and the visible text to make the search more accurate.