Re: [Httpunit-develop] Javascript problem
Brought to you by:
russgold
|
From: Russell G. <rus...@ht...> - 2003-03-28 14:46:06
|
At 03:46 AM 3/28/2003 -0800, Avinash wrote: >Hi , > I am using Httunit to log into site and check my >mails I have pasted my code. The following exception >is getting thrown every time i try. If i set my >javascript disabled it logs in. Can anyone of u guide >me. I have given the path to rhino.jar for javascript. > > HttpUnitOptions.setScriptingEnabled(true); > WebConversation wc = new WebConversation(); > WebRequest req = new GetMethodWebRequest( >"http://mail.yahoo.com" ); > > >/*****I am getting the exception here****/ > > WebResponse resp = wc.getResponse( req ); > WebForm form = resp.getFormWithName("login_form"); This works in 1.5.2: WebConversation wc = new WebConversation(); WebResponse resp = wc.getResponse( "http://mail.yahoo.com" ); WebForm form = resp.getFormWithName("login_form"); String[] names = form.getParameterNames(); for (int i = 0; i < names.length; i++) { System.out.println( "found parameter name: " + names[i] ); } If it is not working for you, you may have a configuration problem. |