0 Replies Latest reply on Dec 1, 2012 6:02 AM by 655260

    HtmlUnit - setAttributeValue or setHiddenInputValue

      Hello again. I can get the attribute value with this method:


      WebClient client = new WebClient();

      HtmlPage page = client.getPage ("http://mydomain.com/welcome.jsp");

      HtmlHiddenInput hidden = (HtmlHiddenInput) page.getElementByName("pagecodes");



      The output = 12345


      Now I need to send this attribute value along with my next page request. The following method would work:

      HtmlPage page = client.getPage ("http://mydomain.com/nextpage.jsp?pagecodes=12345");


      But the above method is cumbersome when submitting a large number of values. I am seeking a method like the following pseudocode:


      HtmlPage page = client.getPage ("http://mydomain.com/nextpage.jsp");

      page.setHiddenInputValue("pagecodes") = 12345;


      Any suggestions are greatly appreciated.