如何在量角器中使用by.model定位角度元素

问题描述 投票:0回答:1

我有这个文本框元素。

<input type="text" name="textbox" class="box-input ng-pristine ng-scope md-input ng-empty ng-valid ng-valid-required ng-touched" ng-required="field.required" ng-model="$ctrl.model[field.nameField.uuid]" ng-disabled="::field.readOnly" id="input_15" aria-invalid="false" style="">

在量角器中,如何使用它来定位元素?我不太确定如何使用ng-model="$ctrl.model[field.nameField.uuid]"

protractor
1个回答
0
投票

尝试这样

let input = element(by.model('$ctrl.model[field.nameField.uuid]'));

如果可能的话,我建议使用唯一的ID,或者使用某些导致单个元素的独特的类样式。

© www.soinside.com 2019 - 2024. All rights reserved.