I'm writing a web testing script with python (2.6) and mechanize (0.1.11). The page I'm working with has an html form with a select field like this:
<select name="field1" size="1">
<option value="A" selected>A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
</select>
In mechanize, if I try something like this:
browser.form['field1'] = ['E']
Then I get an error: ClientForm.ItemNotFoundError: insufficient items with name 'E'
I can do this manually with the "Tamper Data" firefox extension. Is there a way to do this with python and mechanize? Can I somehow convince mechanize that the form actually has the value I want to submit?