zopefoundation/zope.testbrowser — pull request #2 by mgedmin (2013-03-28 08:40:37+00:00)
Title: Bugfix: do not reorder submit controls even if names are shared

Discovered this issue in a test suite of a real project.

There's a submit button repeated twice: once at the top of the form, once at the bottom. It shares the same `value` (i.e. button label) with the third button that exists in the middle of the form.

The old testbrowser assigned indexes to the three buttons in order of HTML appearance. The current testbrowser groups them by name first, which breaks my tests.

I'm not very happy with the solution, can you suggest refactorings?

I haven't explored what happens if you have the same `name` shared between checkboxes and other controls. It should probably be resolved before merging this.