<label> <input style="display: inline-block; margin-top: 5px"
type="checkbox"
ng-model="entity.checked"
ng-change="getEntityFromModal(entity.val, entity.checked)" /> <span>{{entity.val}}</span>
</label>
我试图找到由标签01
与这代表一个复选框:
multiCheckBoxXPath = "//input(@ng-model='entity.checked')/label[contains(text(),'" +value.substring(0, 2) +"')]";
价值在哪里是复选框旁边显示的细长string
版本。显示前两个字母。
我使用[contains(text())
通过标签找到它,然后使用分配的ng-model
尝试选择相应的复选框。
不幸的是我得到 -
Unable to find //input(@ng-model='entity.checked')/label[contains(text(),'01')]
我有点困在这里所以任何想法表示赞赏。
为什么在你的错误信息中缺少'']]'只是一个错字,或者他们真的不在那里? – seekers01
你好,根据你的路径应该包含的源代码@ ng-model ='entity.checked'不是@ ng-model ='depot.checked' –
再次,道歉是一个错字 - 我有两个相同的复选框列表,我必须有在复制时感到困惑。固定。 – xeon48