Q. How do I set a checkbox with a dynamic id attribute?
A. Use a regex match to populate a dynamic variable …
Example html:
<form action="test_0019.html" method="get" accept-charset="utf-8"> <input id="cblRoles_3" type="checkbox" tabindex="47" name="cblRoles:3"/> <label for="cblRoles_3">Customer</label> <input id="cblRoles_4" type="checkbox" tabindex="48" name="cblRoles:4"/> <label for="cblRoles_4">Expedite</label>
Example watir:
dynamic_id = @b.html[/cblRoles_\d+>Expedite/].gsub(">Expedite","") @b.checkbox(:id,dynamic_id).set
No Comments »
RSS feed for comments on this post. TrackBack URL