-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 01/21/2013 01:26 PM, Andreas Jung wrote:
> We are using zope.testbrowser together with Kotti.
>
> Our content-type contains several mandatory "List" fields rendered
> as checkboxes. For functional tests with zope.testbrowser I need
> obviously to click at least of one the checkboxes.
>
> The checkboxes are rendered as
>
> <input id="deformField4-0" type="checkbox"...> <input
> id="deformField4-1" type="checkbox"...> ...
>
> Since the id depends on the ordering of the field I don't want to
> use
>
> browser.getControl('deformField4-0').
>
> Is there any chance choosing a checkbox by value (which is more
> speaking than an auto-generated ID here)?
I assume every checkbox has a label? The "Checkbox Choice Widget" in
the deform demo renders checkbox items like this:
<li class="deformSet-item">
<input type="checkbox" id="deformField1-0" value="habanero"
name="checkbox">
<label for="deformField1-0">Habanero</label>
</li>
<li class="deformSet-item">
...
</li>
This allows you to select the first checkbox by its label, like so:
browser.getControl("Habanero")
Daniel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEARECAAYFAlD9biwACgkQi2kx5isbD8wmmgCfcrsBtUBq8jfcbtISM+MkchIx
nscAnAqWF2jhtzh/xMDAruvDScAJgNaj
=EDuu
-----END PGP SIGNATURE-----
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.