Search code examples
javahttp-unit

setParameter at form


I want submit form with some parameters using httpunit. I wrote smt like

WebForm form = response.getFormWithID(formId);
System.out.println(Arrays.toString(form1.getParameterNames())); //it contains "a"
form.setParameter( "a", "bla-bla"); //exception
form.submit();

But it throws runtime exception org.mozilla.javascript.EvaluatorException: "Form" is not a constructor. Where I'm wrong?


Solution

  • HttpUnit is old and no longer maintained, and also not very widely used.

    HtmlUnit is its spiritual successor. It does the same job, but it has a better API, it works better, and it's actively maintained.