fix for a privately reported bug ("AttributeError: item is disabled")

This commit is contained in:
Miroslav Stampar 2011-05-02 18:18:04 +00:00
parent 93dee30895
commit 5e9620198c

View File

@ -465,7 +465,11 @@ def __findPageForms():
for form in forms: for form in forms:
for control in form.controls: for control in form.controls:
if hasattr(control, 'items'): if hasattr(control, 'items'):
control.items[0].selected = True # if control has selectable items select first non-disabled
for item in control.items:
if not item.disabled:
item.selected = True
break
request = form.click() request = form.click()
url = urldecode(request.get_full_url(), kb.pageEncoding) url = urldecode(request.get_full_url(), kb.pageEncoding)
method = request.get_method() method = request.get_method()