次のようなチェックボックスがあります。
<input type="checkbox" value="true" name="replaceExisting"></input>
残念ながら、次のコードではチェックボックスがチェックされません。
$('checkbox', name:'replaceExisting').value('true')
何か案は?
次のようなチェックボックスがあります。
<input type="checkbox" value="true" name="replaceExisting"></input>
残念ながら、次のコードではチェックボックスがチェックされません。
$('checkbox', name:'replaceExisting').value('true')
何か案は?
チェックボックスに関するGeb ドキュメントは間違っています。
// in the docs; doesn't work.
$('checkbox', name:'replaceExisting').value('true')
// This works:
$('input', type:'checkbox', name:'replaceExisting').value('true')
// This works, too:
$('input', name:'replaceExisting').value('true')
回避策として、これはチェックボックスをオンに設定するために機能します。
js.exec("document.getElementsByName('replaceExisting')[0].checked = true");