Podolszki Ákos Podolszki Ákos - 1 year ago 106
Javascript Question

Selecting an element by ng-click in Protractor

in our angular app there are language icons to change language:

<img style="cursor: pointer; margin-right: 5px; float: left;" height="25px"
src="assets/images/english.jpg" ng-click="setLang('en')" class="">

How can I click on this icon with protractor? Based on other questions this should be the way:


But this one throws a syntax error, because of the 'en' part.
So I also tried these:


But both of these resulted in: No element found using locator

Please advise how can I click on this element?

Answer Source

You need to escape quotes.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download