The HtmlUnit team is pleased to announce the release of HtmlUnit 2.5. This release brings another round of improvements and bug fixes.
Here is an extract of the change log:
- improved JS support, particularly full support for MooTools
- repackaged Rhino classes to allow to use HtmlUnit and a regular Rhino version in the same project
- experimental WebClient.waitForBackgroundJavaScript() and WebClient.waitForBackgroundJavaScriptStartingBefore() for simple, fast and deterministic AJAX testing
- reworked handling of background JS tasks using JDK5 executors
- …
Download: http://sourceforge.net/project/showfiles.php?group_id=47038
Saif Khan said,
September 25, 2009 at 10:18 am
I am using JWebunit with HTMLUnit as its test plugin. All the test cases go well but when i use it with dojo it gives me following error:
java.lang.RuntimeException: com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method “getValue” of undefined (script in http://localhost:8080/ctrust/DeclinedTransctionsAction.action from (101, 32) to (447, 11)#121) (script in http://localhost:8080/ctrust/DeclinedTransctionsAction.action from (101, 32) to (447, 11)#378)
at net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.clickButton(HtmlUnitTestingEngineImpl.java:1900)
at net.sourceforge.jwebunit.junit.WebTester.clickButton(WebTester.java:2522)
at net.sourceforge.jwebunit.junit.WebTestCase.clickButton(WebTestCase.java:2020)
at test.TestObsDecTrans.testObsDecTransScreen(TestObsDecTrans.java:51)
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:597)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:79)
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:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
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: com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method “getValue” of undefined (script in http://localhost:8080/ctrust/DeclinedTransctionsAction.action from (101, 32) to (447, 11)#121) (script in http://localhost:8080/ctrust/DeclinedTransctionsAction.action from (101, 32) to (447, 11)#378)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:534)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:515)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:464)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:992)
at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventHandler(EventListenersContainer.java:164)
at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:177)
at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:574)
at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:936)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:515)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:941)
at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1317)
at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1288)
at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1257)
at net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.clickButton(HtmlUnitTestingEngineImpl.java:1898)
… 22 more
Caused by: net.sourceforge.htmlunit.corejs.javascript.WrappedException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method “getValue” of undefined (script in http://localhost:8080/ctrust/DeclinedTransctionsAction.action from (101, 32) to (447, 11)#121) (script in http://localhost:8080/ctrust/DeclinedTransctionsAction.action from (101, 32) to (447, 11)#378)
at net.sourceforge.htmlunit.corejs.javascript.Context.throwAsScriptRuntimeEx(Context.java:1773)
at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:183)
at net.sourceforge.htmlunit.corejs.javascript.FunctionObject.call(FunctionObject.java:476)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:3330)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:2487)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:267)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
at com.gargoylesoftware.htmlunit.javascript.host.EventHandler.call(EventHandler.java:82)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:492)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:457)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:528)
… 37 more
Caused by: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method “getValue” of undefined (script in http://localhost:8080/ctrust/DeclinedTransctionsAction.action from (101, 32) to (447, 11)#121)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:534)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:515)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:464)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:992)
at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventHandler(EventListenersContainer.java:164)
at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:177)
at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:584)
at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:936)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:515)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:941)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1237)
at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:183)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:449)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:354)
at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:179)
at com.gargoylesoftware.htmlunit.javascript.host.HTMLFormElement.jsxFunction_submit(HTMLFormElement.java:251)
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:597)
at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:161)
… 49 more
Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot call method “getValue” of undefined (script in http://localhost:8080/ctrust/DeclinedTransctionsAction.action from (101, 32) to (447, 11)#121)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3660)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3679)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3698)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2221)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2214)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:3143)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:2487)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at com.gargoylesoftware.htmlunit.javascript.host.EventHandler.call(EventHandler.java:82)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:492)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:457)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:528)
… 72 more
The method getValue is of dojo date widget and its calling is present on the page, but it cannot find its required js to find the getValue method. I am using dojo with struts2 as a defualt UI plugin. How can i resolve this issue please help me in this regard.
Best Wishes,
Saif Khan
Marc Guillemot said,
September 25, 2009 at 11:09 am
Saif,
please use HtmlUnit’s mailing list to discuss issues that you encounter with HtmlUnit.