[Webtest] array of values for <setcheckbox>
Marc Guillemot
webtest@lists.canoo.com
Fri, 30 Jul 2004 11:13:34 +0200
> Check boxes with multiple set return data exactly the same way as select
> lists do. So I use the new_setselectfield tag.
why doesn't new_setcheckbox work? Giving the value attribute, you can specify which check box you want to (un)check when
many checkboxes have the same name.
Using "new_setselectfield" to set something else as select fields will bring you problems when a better check will be
performed. Later when we will move to htmlunit.
> However there is a BUG in
> the code there.
>
> This:
>
> List li = Arrays.asList(form.getParameterValues(getName()));
> li.add(strValue);
> form.setParameter(getName(), (String[]) li.toArray(new String[]{}));
>
> Should be something like this:
>
> ArrayList al = new
> ArrayList(Arrays.asList(form.getParameterValues(getName())));
> al.add(strValue);
> form.setParameter(getName(), (String[]) al.toArray(new String[]{}));
ok. Have you a webtest for this bug?
Marc.