Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

binding locator in Protractor

I have a problem with ng-binding locator in Protractor code:    
<h1 class="blackText ng-binding">some_link</h1>

I tried to use:
element(by.binding('some_link')).click();

but it's not finding anything.

This works:
element(by.cssContainingText('.ng-binding', 'some_link')).click();

but I would like to use binding locator.

Any ideas ?

like image 855
QAinCharge Avatar asked Dec 19 '22 07:12

QAinCharge


1 Answers

See this for an example: https://docs.angularjs.org/api/ng/directive/ngBind

Note that in the example you're doing element(by.binding('name')), and not element(by.binding('Whirled')). Basically don't use what the binding evaluates to, but the binding's name.

like image 156
hankduan Avatar answered Jan 04 '23 22:01

hankduan