我现在正在使用WebdriverIO和开发一个网络应用程序。这些天我尝试根据输入设置日期type="date",但出现错误
无效元素状态:元素必须是用户可编辑的才能清除它。
并发现我可以通过使用来消除错误addValue(),但该值仍然不会被任何 API 清除。
client.clearElement('#deadline')
Run Code Online (Sandbox Code Playgroud)
还得到
无效元素状态:元素必须是用户可编辑的才能清除它。
如何从表单中删除该值?
这对我有用:
client.selectorExecute("#dateInput", function(inputs, value) {
// you can run over the inputs
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == 'date') // any condition
inputs[i].value = "1973-12-09";
}
// or just do that:
inputs[i].value = "1973-12-09";
return;
})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2904 次 |
| 最近记录: |