1 Reply Latest reply on Sep 6, 2010 6:27 AM by 791266

    HttpUnit form submit

    843789
      Hi i'm leo. I'm using HttpUnit 1.7 and I'm trying to make a test with the page http://lrrt12.elbruto.es/login and my problem is that i can't submit the form to login into my account here is my code:

      public void pagina1() throws Exception{
                
                WebConversation wc = new WebConversation();
                HttpUnitOptions.setExceptionsThrownOnScriptError(false);
           WebResponse pag1 = wc.getResponse( "http://lrrt12.elbruto.es/login" );
           System.out.println(pag1.getTitle());
           WebForm form = pag1.getForms()[0];
           form.setAttribute("pass", "************");
           form.getButtons()[0].click();
           WebResponse pag2 = wc.getCurrentPage();
           System.out.println(pag2.getURL());
           
           
           
           }


      but i can't login!!! what can i do? is there another way to submit a form? i've tried whit form.submit() but it doesn't work =S can you help me?