vendredi 27 février 2015

Clicking a checkbox using protractor


There is no unique model, id, label names. How am I suppose to check/click the checkboxes?


The html/code is:



<div ng-repeat="column in $parent.columns.standardMetrics" class="ng-scope">
<label class="ng-binding">
<input type="checkbox" ng-model="column.visible" name="" class="ng-pristine ng-valid">
uCPM
</label>
</div>

</div><div ng-repeat="column in $parent.columns.standardMetrics" class="ng-scope">
<label class="ng-binding">
<input type="checkbox" ng-model="column.visible" name="" class="ng-pristine ng-valid">
CPM
</label>
</div>


There is about 15 of these with the same name besides the label next to the name. I searched everywhere to see if protractor allows you to find elements by label.


My attempts are finding via by.buttonText, by.partialButtonText, by.css and by.binding. I have no luck on this.


My purpose is to pass in a label name that I can toggle the specific checkbox. So it's like element(by.css(header)).click(); where header is what is passed in.





Aucun commentaire:

Enregistrer un commentaire