我在 geb 中使用了 div.find("input","checked":contains("checked"))
。
这是我用来识别网页的选中单选按钮的实际代码片段,但它在 "input","checked":contains("checked")
上出错
seletedRadio(wait:true,required:false){
$("tbody.option-group-container")
.getAt(0)
.find("input","checked":contains("checked"))
.next("label")
.find("span.label-text")
}
最佳答案
对复选框使用此语法:
find("input:checkbox:checked")
这是 radio :
find("input:radio:checked")
(这似乎也是 seletedRadio 单词中的错别字。)
关于javascript - 无法使用选中的 ="Checked"属性找到单选按钮元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46405428/