Hi,
jwebunit throws EcmaError: TypeError: Cannot find functoin createElement
while trying to execute javascript code containing
:document.createElement()".
Where as, document.getElementById() seems to be working fine and not
throwing the above error.
Is there a way by which jwebunit can support document.createElement()
related javascript?
Thanks,
Chandra
ex:-
<html>
<body>
<SCRIPT TYPE="text/javascript">
<!--
function somefunc()
{
var img = document.createElement("img");
return img;
}
// -->
</SCRIPT>
<form name="abc" id="abc"
method="get"
action="http://some_url" onSubmit="return somefunc()"
style="margin:0px" enctype="multipart/form-data">
<input type="submit">
</form>
</body>
</html>
corresponding .java code looks like:
...
webTester.getDialog().submit();
...
here is the stack trace:
org.mozilla.javascript.EcmaError: TypeError: Cannot find function
createElement.
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3226)
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3216)
at
org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3232)
at
org.mozilla.javascript.ScriptRuntime.typeError1(ScriptRuntime.java:3244)
Exception in thread "main" java.lang.RuntimeException:
com.meterware.httpunit.ScriptException: Event 'return somefunc()' failed:
org.mozilla.javascript.EcmaError: TypeError: Cannot find function
createElement.
at
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptException(JavaScript.java:202)
at
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(JavaScript.java:175)
at
com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelegate.java:56)
at
com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSource.java:232)
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users