I added your example as a test case, and it gives different results
depending on which version of httpunit I use. But never the same error
that you get. Do you have the Rhino jar js-1.6R2.jar?
With httpunit-1.5.4 your example runs successfuly without modification.
With httpunit-1.6 or the latest snapshot, I have to add name="go" to
the submit button and submit("go") in the code. If not, httpunit says
"Error submitting form using default submit button, check that form
has single submit button". I have seen that problem before, but I have
not found the reason yet. Anyway, with that modification I get
"org.mozilla.javascript.EcmaError: TypeError: Cannot set property
"target" of undefined to "newt" (httpunit#3)". That is probably the
same error but with better error reporting. Is the first line of the
script valid?
/Staffan
On 12/29/05, Nilesh Trivedi <[EMAIL PROTECTED]> wrote:
> I have this JSP page:
>
> <html>
> <body>
> <!-- JavaScript
> ------------------------------------------------------>
> <script language="JavaScript">
>
> function openReport()
> {
> var myform = document.forms['report-input'];
> myform.target = "newt";
> return false;
> }
> </script>
> <!-- End of JavaScript
> ----------------------------------------------->
> <form id="form1" name="report-input" target="" method="POST"
> action="nothing.jsp" onSubmit="openReport()" >
> <input type="submit" value="go" />
> </form>
> hi
> </body>
> </html>
>
>
> And I am using the following test case to access this page:
>
> public void testNow() throws Exception
> {
> beginAt("/mserver/jsp/test.jsp");
> setWorkingForm("form1");
> submit();
> return;
> }
>
>
> When I run the test, I get the following exception:
>
> org.mozilla.javascript.EvaluatorException: The undefined
> value has no properties. (httpunit; line 3)
> at
> org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:76)
> at
> org.mozilla.javascript.Context.reportRuntimeError(Context.java:591)
> at org.mozilla.javascript.Context.reportRuntimeError
> (Context.java:630)
> at
> org.mozilla.javascript.Context.reportRuntimeError0(Context.java:600)
> at
> org.mozilla.javascript.Undefined.reportError(Undefined.java:138)
>
> Can anyone help me with this issue ?? Looks more like an issue with
> httpunit, but I am just wondering if anyone else has faced similar problems.
>
> Thanks a lot.
>
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users