splinter icon indicating copy to clipboard operation
splinter copied to clipboard

fill_form - option to ignore missing fields?

Open victorhooi opened this issue 12 years ago • 2 comments

Hi,

Currently, when you use fill_form, and there is an key present in your dict, that is not present on the page, it will raise a:

ElementDoesNotExist: no elements could be found with name "cvv2_cc"

Would it be possible to make configurable fill_form to ignore missing fields?

Basically, I'd like it to fill in as many of the fields as it can, and if there are any missing, just continue on. (In my case, I have a dict that I'd like to use on two different pages - one of those pages has an extra field, I'd rather not duplicate the whole dict again).

Thoughts?

Cheers, Victor

victorhooi avatar Jan 21 '14 03:01 victorhooi

we can add a parameter, something like:

browser.fill_form(..., ignoring_missing=True)

andrewsmedina avatar Jan 21 '14 15:01 andrewsmedina

Implemented by #821

javascript-error avatar Oct 16 '20 02:10 javascript-error