I am writing a web testing script using python (2.6) and mechanize (0.1.11). On the page I'm working with, there is an html form with the selected field as follows:
<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 mechanization, if I try something like this:
browser.form['field1'] = ['E']
Then I get the error message: ClientForm.ItemNotFoundError: insufficient items with name 'E'
I can do this manually with the Firefox extension "Tamper Data". Is there any way to do this with python and mechanize? Can I somehow convince me to mechanize that the form really has the meaning that I want to represent?
source
share