I have a block of HTML code that contains a button
<button class="someButton" onclick="openPage('test')"></button>
I need to click on this button with Mechanize.
Mechanize has API to work with buttons via forms. But:
- Mechanize can interact with buttons only via forms and there is not
form, just a single button - Creating form manually does not allow to click on button because it supports only buttons that make submit
Is there any way how to click on button with custom event?
Mechanize doesn’t do javascript so button events just get ignored. For that you need a full browser like watir, watir-webdriver, selenium-webdriver, celerity, capybara-webkit or one that I missed.