Is there someone that know how to submit this form with HtmlUnit, Java?
<form name="sendSmsForm" method="POST" action="/talkmore3/servlet/SendSmsFromSelfcare" onsubmit="return checkBeforeSubmit();">
<input type="hidden" value name="message1" id="message1"/>
<input type="hidden" value name="list" id="list"/>
<table border="0" width="560">
<tbody>
<tr>
<td>
<div id="ContactListPanel">
<iframe height="425" width="560" frameborder="0" scrolling="no" id="ContactListFrame" name="ContactListFrame" src="/talkmore3/servlet/ManageContactList">
</iframe>
</div>
</td>
</tr>
<tr align="left">
<td colspan="2" align="left">
<div class="button_green" style="width: 114px; float: left;margin-left: 130px">
<a href="javascript:sendSMS();" title="Send SMS">
<span>
Send SMS
</span>
</a>
</div>
</td>
</tr>
</tbody>
</table>
</form>
I have tried with this:
HtmlForm form = page.getFormByName("sendSmsForm");
form.getInputByName("list").setValueAttribute("99999999");
form.getInputByName("message1").setValueAttribute("test");
HtmlAnchor submit = page.getFirstByXPath("//a[@href='javascript:sendSMS();']");
submit.click();
But it seems like it does not get the values of the input..