I am using htmlunit to automatically go through a website. Here is the problem:
I want to click on an anchor in order to display a new page of a given table.
Here is the anchor:
<a href="javascript:__doPostBack('GridView1','Page$7')">7</a>
Here is my code:
final HtmlAnchor a = page2.getAnchorByText("7");
HtmlPage page3 = a.click();
System.out.println(page2.getWebResponse().getContentAsString())
System.out.println(page3.getWebResponse().getContentAsString());
I do not have any error message. When I compare my print out, they are identical, and yet they shouldn't be, as I just clicked on an anchor. First print out should display a certain page of the table, a the second print out another one.
The stackoverflow post struggling to click on link within htmlunit renders a very similar problem, however his solution (setting the browser version to the webclient) does not appear to work in my case.