[twill] Twill not capable of handling multiple form fields with the

Stephen Thorne stephen at netboxblue.com
Tue Apr 18 16:07:13 PDT 2006


Jeff Forcier wrote:
> I'm pretty sure my problem is also b); if I do not use twill to try
> and manipulate the dropdowns (they have default values) then twill
> itself works fine. Once the data passes through twill, yes, what
> should be three values becomes just one value, in this case the
> selected value of the last/third dropdown.

See attached patch. I have two things in there, one is for specifying a 
fieldnum, the other is for being able to specify the name of the form 
for submitting, which is useful in the following case:
<form><input type='submit' name='foo'></form>
<form><input type='submit' name='bar'></form>

you can do:

submit 'bar' 2

to submit the 'bar' button on the second form, this is otherwise 
impossible because you can only select the second form by modifying a field.

the fieldvalue call has been changed to do this:

fieldvalue myform myfield myvalue 2

to change the 2nd field of that name.

> So yea, if you have that patch handy, I definitely wouldn't mind
> taking a peek at it to see if it looks like it'd address my particular
> issue. I haven't yet used darcs; when you say "the tests" I assume you
> mean twill's own tests?

Yeah, I mean twills own tests. You can add the webpage to 
twill/tests/twilltestserver.py and either do something in the style of 
test-checkbox.py (that's my style of using twill) or call 
twilltestlib.execute_twill_script('test-form.twill', initial_url=url) 
like test-form.py, and add a .twill file.

:)
-- 
Regards,
Stephen Thorne
Development Engineer

Scanned by the NetBox from NetBox Blue
(http://netboxblue.com/)




-------------- next part --------------
A non-text attachment was scrubbed...
Name: fieldnum.patch
Type: text/x-patch
Size: 3750 bytes
Desc: not available
Url : http://lists.idyll.org/pipermail/twill/attachments/20060418/1f840c59/fieldnum.bin


More information about the twill mailing list