I'm using HTMLunit to fill out a form on a site, but get stuck on an HTMLanchor which needs to submit it.
the html code:
<a id="syi-place-ad-button" class="button primary medium "><span>Plaats uw advertentie</span></a>
trying to click it:
HtmlAnchor submitButton = (HtmlAnchor) page2.getElementById("syi-place-ad-button");
form2.appendChild(submitButton);
page3 = submitButton.click();;
webClient.waitForBackgroundJavaScript(10*1000);
webClient.setAjaxController(new NicelyResynchronizingAjaxController());
WebResponse response = page3.getWebResponse();
String content = response.getContentAsString();
System.out.println(content);
webClient.closeAllWindows();
gives this error in the end:
== CALLING JAVASCRIPT ==
function (e) {
return st === t || e && st.event.triggered === e.type ? t : st.event.dispatch.apply(s.elem, arguments);
}
======= EXCEPTION END ========
can anyone help me on my way to what I might be missing or doing wrong here?