Be specific enough (but no more) to uniquely select 1 element
Generally look to css selectors first, for greatest readability.
Try using button[type='submit']
for your selector and click
on it, e.g.
findElement("button[type='submit']").click
if that is not specific enough, scope it to the button
or form
class, examples:
button.booking[type='submit']
form button.booking[type='submit']
form.booking button[type='submit']
# Allow form to be put anywhere on the page and other forms to exist
If that is not specific enough (the page has two forms with the same name...) you can scope it to the specific occurrence, e.g. for the first occurrence use:
form.booking button.booking[type='submit'][0]`
# However this is now tied to page layout if form order is changed
"but no more" in the title generally means don't hard-code a selector using the surrounding page layout. It may be unique but it then becomes tied the the page layout and breaks if the layout changes.