From: Tom H. <Tom...@fu...> - 2003-06-05 10:52:39
|
Ok. What I have is a form that is submitted via an anchor tag. The tag calls javascript:formName.submit() The exception I get here is this: Exception class=[org.mozilla.javascript.JavaScriptException] com.gargoylesoftware.htmlunit.ScriptException: java.lang.NullPointerException at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript Engine.java:196) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(Html Page.java:767) at com.gargoylesoftware.htmlunit.html.HtmlAnchor.click(HtmlAnchor.java:68) I have tried different approaches - like calling form.submit() in the test harness - but this just does a javascript form submit(). If I do this I get a different exception. java.lang.NullPointerException at org.apache.commons.httpclient.HttpMethodBase.getResponseBody(HttpMethodBase. java:670) at org.apache.commons.httpclient.methods.GetMethod.getResponseBody(GetMethod.ja va:293) at com.gargoylesoftware.htmlunit.HttpWebConnection.makeWebResponse(HttpWebConne ction.java:302) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnectio n.java:106) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:928) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:305) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:242) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:137) What I am actually getting back from the server is a 100 - Continue - presumably with no body. What is actually happening is that the page should be redirected to another page (struts forward). So I'm a bit confused as why I am getting errors? You help is most welcome.... -----Original Message----- From: Mike Bowler [mailto:mb...@Ga...] Sent: 05 June 2003 10:58 To: 'htm...@li...' Subject: Re: [HtmlUnit] Error when submitting a form based on javascript.submit() Tom Hamilton wrote: > EcmaError: lineNumber=[1] column=[0] lineSource=[GargoyleWrapper0()] > name=[TypeError] sourceName=[Wrapper definition for javascript url] > message=[com.gargoylesoftware.htmlunit.javascript.host.Submit@3a5c7a > is not a function.] errorObject=[TypeError: > com.gargoylesoftware.htmlunit.javascript.host.Submit@3a5c7a is not a > function.] There isn't enough information here to be sure but I'd guess that this form contains an element with the name "submit". HtmlUnit is then finding that element before it finds the submit() method and is trying to execute it. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ HtmlUnit-develop mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-develop ___________________________________________________________________________ This message is intended solely for the use of the individual or organisation to whom it is addressed and may contain confidential or copyrighted information. If you have received this message in error, please reply to the originator and delete it immediately. If you are not the intended recipient, you should not use, copy, alter, disseminate, print or disclose the contents of this message. Information or opinions expressed in this message and/or any attachments are those of the author and are not necessarily those of EFSS Ltd. or its affiliates. EFSS Ltd. accepts no responsibility for loss or damage arising from its use, including damage from viruses. Note: Internet e-mails are not necessarily secure. EFSS Ltd. does not accept responsibility for changes made to this message after it was sent. ___________________________________________________________________________ |