From: <th...@cy...> - 2003-03-18 12:19:25
|
Hi, it's me again. You told me before, that JavaScript-support should work completely transparent. For example, if I choose an option of a select-formfield, HtmlUnit should automatically fire up the JavaScript-code stored in the onChange-attribute. Well, it doesn't. Below you'll find some code-fragments and the stacktrace. If there is any more I can do, to help you to degbug this, please let me know. The JavaScript stored in the onChange-attribute: onChange="form.target='_self'; if (options[selectedIndex].value.indexOf('|') >= 0) {form.target=options[selectedIndex].value.split('|')[1];} form.submit();" The option-values look something like this: "view_object|_self" The form includes some more JavaScript. Allthough I don't think it has any influences on that bug, I'll send it to you anyways: <script type="text/javascript"> <!-- document.write('<input type="hidden" name="navigator-vi-menu-cf-go" value="go">'); // --> </script> There is also a noscript-part to it, which just contains the button again (but type="submit"). See my mail before ;) And that is the exception I get: ======= EXCEPTION START ======== EcmaError: lineNumber=[1] column=[0] lineSource=[GargoyleWrapper0()] name=[TypeError] sourceName=[Wrapper definition for onChange handler] message=[Cannot convert null to an object.] errorObject=[TypeError: Cannot convert null to an object.] com.gargoylesoftware.htmlunit.ScriptException: Cannot convert null to an object. at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:199) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:764) at com.gargoylesoftware.htmlunit.html.HtmlSelect.setSelectedAttribute(HtmlSelect.java:142) at webtester.Menu.executeSelect(Menu.java:62) at webtester.Menu.selectOption(Menu.java:53) at npsGuiTests.SimpleTest.objectCreate(SimpleTest.java:70) at npsGuiTests.SimpleTest.runTest(SimpleTest.java:21) at npsGuiTests.RunTests.main(RunTests.java:17) Enclosed exception: TypeError: Cannot convert null to an object. (Wrapper definition for onChange handler; line 1) at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:597) at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:557) at org.mozilla.javascript.NativeGlobal.typeError0(NativeGlobal.java:562) at org.mozilla.javascript.ScriptRuntime.setProp(ScriptRuntime.java:840) at org.mozilla.javascript.gen.c11.call(Wrapper definition for onChange handler:1) at org.mozilla.javascript.optimizer.OptRuntime.callSimple(OptRuntime.java:275) at org.mozilla.javascript.gen.c13.call(onChange handler:1) at org.mozilla.javascript.gen.c13.exec(onChange handler) at org.mozilla.javascript.Context.evaluateReader(Context.java:820) at org.mozilla.javascript.Context.evaluateString(Context.java:784) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:191) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:764) at com.gargoylesoftware.htmlunit.html.HtmlSelect.setSelectedAttribute(HtmlSelect.java:142) at webtester.Menu.executeSelect(Menu.java:62) at webtester.Menu.selectOption(Menu.java:53) at npsGuiTests.SimpleTest.objectCreate(SimpleTest.java:70) at npsGuiTests.SimpleTest.runTest(SimpleTest.java:21) at npsGuiTests.RunTests.main(RunTests.java:17) == CALLING JAVASCRIPT == GargoyleWrapper0() ======= EXCEPTION END ======== If I may priorize the bugs a bit, I'd prefer you to help me with the bug reported before (<noscript>). JavaScript has not a major level of importance in my tests. kind regards, Thomas Bartz Berlin |