aspose file tools*
The moose likes Testing and the fly likes HttpUnit - org.mozilla.javascript.EcmaError: TypeError: Cannot find function createElement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "HttpUnit - org.mozilla.javascript.EcmaError: TypeError: Cannot find function createElement" Watch "HttpUnit - org.mozilla.javascript.EcmaError: TypeError: Cannot find function createElement" New topic
Author

HttpUnit - org.mozilla.javascript.EcmaError: TypeError: Cannot find function createElement

Gnanasekaran Sakthivel
Greenhorn

Joined: Jul 14, 2004
Posts: 23



com.meterware.httpunit.ScriptException: Script 'somefunction()' failed: org.mozilla.javascript.EcmaError: TypeError: Cannot find function createElement. (httpunit#419)
at junit.framework.Assert.fail(Assert.java:47)
at test.applicant.ApplicantCreateTest.testApplicantCreate(ApplicantCreateTest.java:58)
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:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
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)



document.getElementById scripts are ok... this createElement seems to have problem. Does document refer to something else and passes getElementById.
Can someone help me with this...
Thanks guys.


Best Wishes
Gnanasekaran Sakthivel
Greenhorn

Joined: Jul 14, 2004
Posts: 23
Initially I thought this might be due to the following situation: I have this problem in a script (called onload of html body) in a jsp which is included in another main jsp.
I thought may be while executing the (included) jsp to generate html, this document is not ready completely or may be does not exists. Then I just copied the whole page from the included JSP and put it in the main JSP itself. It did not work still, giving the same error message. However works good without script errors, in couple browsers, when you access the app through them.
Anyone have any thoughts. Or does anyone has scripts with document.createElement at body onload event through HttpUnit testing...
I cannot turn off scripting while testing because our app relies on this.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HttpUnit - org.mozilla.javascript.EcmaError: TypeError: Cannot find function createElement