Hello. I'm using HtmlUnit to click on a HtmlElement that triggers Javascript action:
currentPage = ((HtmlElement) currentPage.getByXPath("//*[contains(@onclick, 'check();')]").get(0)).click();
The element is:
<a href="#" onclick="check(); return false;">
The page returned is quite similar to the page, containing that element: same URL, mostly same HTML, but there are some minor differences in the HTML and HtmlUnit doesn't save the new page. I'm using HttpAnalyzer to sniff the traffic and I see that the Webclient correctly handles JS and send the right request. The response is also correct, but when I dump the contents of the currentPage to a file, I see that the actual page didn't change. How can I fix it?