Rozmeen Ali
Rozmeen Ali

Reputation: 107

How to handle ng- click() with argument in a Protractor

Code line:

ng-click="my.Update(Profile)"

Now how will I locate this element in protractor?

Upvotes: 0

Views: 1272

Answers (1)

alecxe
alecxe

Reputation: 473873

You can use a CSS selector to locate this element:

$('[ng-click="my.Update(Profile)"]');

Note that you don't have to check the complete value of the ng-click attribute and can use a partial match instead, for instance:

$('[ng-click*=Profile]');
$('[ng-click*=Update]');

The $ is a shortcut to element(by.css()).

Upvotes: 4

Related Questions