Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error on Test JSF

843844Oct 16 2007 — edited Nov 29 2007
I am using JWebUnit for testing MyFaces web-app
I would like to fill the form and submit:
        assertFormPresent("userForm");
        assertSubmitButtonPresent("userForm:submitAdd");
        setTextField("userForm:userName", "user1");
        setTextField("userForm:firstName", "User");
        setTextField("userForm:middleName", "T");
        setTextField("userForm:lastName", "Test");
        setTextField("userForm:email", "user@email.com");
        setTextField("userForm:institution", "Lab");
        checkCheckbox("userForm:_idJsp13");
        submit("userForm:submitAdd");
======= EXCEPTION START ========
EcmaError: lineNumber=[1] column=[0] lineSource=[function () {] name=[TypeError] sourceName=[event for HtmlSubmitInput[<input value="Save" type="submit" onclick="if(typeof window.clearFormHiddenParams_userForm!='undefined'){clearFormHiddenParams_userForm('userForm');}if(typeof window.getScrolling!='undefined'){oamSetHiddenInput('userForm','autoScroll',getScrolling());}" name="userForm:submitAdd" id="userForm:submitAdd">]] message=[TypeError: getScrolling is not a function, it is null. (event for HtmlSubmitInput[<input value="Save" type="submit" onclick="if(typeof window.clearFormHiddenParams_userForm!='undefined'){clearFormHiddenParams_userForm('userForm');}if(typeof window.getScrolling!='undefined'){oamSetHiddenInput('userForm','autoScroll',getScrolling());}" name="userForm:submitAdd" id="userForm:submitAdd">]#1)]
com.gargoylesoftware.htmlunit.ScriptException: TypeError: getScrolling is not a function, it is null. (event for HtmlSubmitInput[<input value="Save" type="submit" onclick="if(typeof window.clearFormHiddenParams_userForm!='undefined'){clearFormHiddenParams_userForm('userForm');}if(typeof window.getScrolling!='undefined'){oamSetHiddenInput('userForm','autoScroll',getScrolling());}" name="userForm:submitAdd" id="userForm:submitAdd">]#1)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:322)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:736)
at com.gargoylesoftware.htmlunit.html.HtmlPage.runEventHandler(HtmlPage.java:1489)
at com.gargoylesoftware.htmlunit.html.HtmlPage.runEventHandler(HtmlPage.java:1465)
at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:103)
at net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog.submit(HtmlUnitDialog.java:1371)
at net.sourceforge.jwebunit.junit.WebTester.submit(WebTester.java:1919)
at net.sourceforge.jwebunit.junit.WebTestCase.submit(WebTestCase.java:1475)
at user.admin.view.test.usersTest.testuserAdd(usersTest.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:58)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.mozilla.javascript.EcmaError: TypeError: getScrolling is not a function, it is null. (event for HtmlSubmitInput[<input value="Save" type="submit" onclick="if(typeof window.clearFormHiddenParams_userForm!='undefined'){clearFormHiddenParams_userForm('userForm');}if(typeof window.getScrolling!='undefined'){oamSetHiddenInput('userForm','autoScroll',getScrolling());}" name="userForm:submitAdd" id="userForm:submitAdd">]#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3229)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3219)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3235)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3254)
at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3309)
at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1652)
at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:1906)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2923)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2251)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:161)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:340)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:151)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2758)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:159)
at com.gargoylesoftware.htmlunit.javascript.host.EventHandler.call(EventHandler.java:95)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:363)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:318)
... 27 more
Enclosed exception:
org.mozilla.javascript.EcmaError: TypeError: getScrolling is not a function, it is null. (event for HtmlSubmitInput[<input value="Save" type="submit" onclick="if(typeof window.clearFormHiddenParams_userForm!='undefined'){clearFormHiddenParams_userForm('userForm');}if(typeof window.getScrolling!='undefined'){oamSetHiddenInput('userForm','autoScroll',getScrolling());}" name="userForm:submitAdd" id="userForm:submitAdd">]#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3229)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3219)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3235)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3254)
at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3309)
at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1652)
at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:1906)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2923)
at script(event for HtmlSubmitInput[<input value="Save" type="submit" onclick="if(typeof window.clearFormHiddenParams_userForm!='undefined'){clearFormHiddenParams_userForm('userForm');}if(typeof window.getScrolling!='undefined'){oamSetHiddenInput('userForm','autoScroll',getScrolling());}" name="userForm:submitAdd" id="userForm:submitAdd">]:1)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2251)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:161)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:340)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:151)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2758)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:159)
at com.gargoylesoftware.htmlunit.javascript.host.EventHandler.call(EventHandler.java:95)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:363)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:318)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:736)
at com.gargoylesoftware.htmlunit.html.HtmlPage.runEventHandler(HtmlPage.java:1489)
at com.gargoylesoftware.htmlunit.html.HtmlPage.runEventHandler(HtmlPage.java:1465)
at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:103)
at net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog.submit(HtmlUnitDialog.java:1371)
at net.sourceforge.jwebunit.junit.WebTester.submit(WebTester.java:1919)
at net.sourceforge.jwebunit.junit.WebTestCase.submit(WebTestCase.java:1475)
at user.admin.view.test.usersTest.testuserAdd(usersTest.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:58)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
== CALLING JAVASCRIPT ==
function () {
[native code, arity=0]
}

======= EXCEPTION END ========


Could you help me?
what is that?
Caused by: org.mozilla.javascript.EcmaError: TypeError: getScrolling is not a function, it is null. (event for HtmlSubmitInput[<input value="Save" type="submit" onclick="if(typeof window.clearFormHiddenParams_userForm!='undefined'){clearFormHiddenParams_userForm('userForm');}if(typeof window.getScrolling!='undefined'){oamSetHiddenInput('userForm','autoScroll',getScrolling());}" name="userForm:submitAdd" id="userForm:submitAdd">]#1)
While I cannot submit?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 27 2007
Added on Oct 16 2007
1 comment
92 views