我有单选按钮,如何通过ng-model
然后ng-value
首先获得第二次单击查找:
<input type="radio" ng-model="vm.ist.educationVsInternship" ng-value=false />
<input type="radio" ng-model="vm.ist.educationVsInternship" ng-value=true />
我试过像
这样的东西element(by.model('vm.ist.educationVsInternship')).all(by.css('[ng-value=true]')).click();
说并且不点击其中任何一个
more than one element found for locator by.model("vm.ist.educationVsInternship") - the first result will be used
和此:
element(by.model('vm.ist.educationVsInternship')).element(by.css('[ng-value=true]')).click();
给出了以下错误消息:
失败:找不到使用定位器找到的元素:By.cssSelector(“[ng-value = true]”)
答案 0 :(得分:1)
您可以组合这样的属性选择器:
$('input[ng-model="vm.ist.educationVsInternship"][ng-value="true"]')