Open domenkozar opened 12 years ago
There is no library to do such things so we will wait until one appears. If we want to add that by ourself it will need to much code to maintain. We don't want that.
I"m not convinced any such library will appear by itself since this type of problem seems to be very specific to WebTest-like usage, so WebTest would be the logical source of such a library.
We've run into this again... and I had a quick look at the code of forms.Form._parse_fields. There's a line for pos, node in enumerate(self.html.findAll(tags)):
which searches for elements that are ancestors of the Form, ie, the assumption is made that all form inputs will be descendants of the Form.
I gather that all webtest's elements are elements that originate from the response object passed to them. If that's the case, can't this issue be dealt with by simply doing a self.response.html.findAll(tags) and then ALSO filtering for tags that are either descendants of the form or have a form= attribute matching the Form's ID?
Somehow this does not seem like a huge stretch (provided I understand the code correctly)?
A first step beside the form
attribute would be to support formaction
and formmethod
when calling click on a button. This would already cover use cases like #175
Anonymous:
Iwan Vosloo:
URL: https://bitbucket.org/ianb/webtest/issue/45/html5-form-associated-inputs-break-webtest