Menu

#1141 HtmlUnit failed to fire submit event to upload files.

closed
None
5
2012-10-21
2010-07-16
Frank Lin
No

Exception occurred while load HelloApp, which is handling file upload in com.google.gwt.user.client.ui.FormPanelTest

======= EXCEPTION START ========
Exception class=[net.sourceforge.htmlunit.corejs.javascript.JavaScriptException]
com.gargoylesoftware.htmlunit.ScriptException: [object Object] (script in http://www.corp.google.com/~flin/HelloApp/hello/6E269C58BB891EB9F27841B893E76B02.cache.html from (13, 9) to (1126, 13)#97)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:601)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:531)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:906)
at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptFunctionJob.runJavaScript(JavaScriptFunctionJob.java:53)
at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptExecutionJob.run(JavaScriptExecutionJob.java:84)
at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl.runJob(JavaScriptJobManagerImpl.java:226)
at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl.runSingleJob(JavaScriptJobManagerImpl.java:307)
at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptExecutor.run(JavaScriptExecutor.java:182)
at java.lang.Thread.run(Thread.java:619)
Caused by: net.sourceforge.htmlunit.corejs.javascript.JavaScriptException: [object Object] (script in http://www.corp.google.com/~flin/HelloApp/hello/6E269C58BB891EB9F27841B893E76B02.cache.html from (13, 9) to (1126, 13)#97)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1062)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:429)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:269)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3162)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:559)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:524)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:595)
... 10 more
JavaScriptException value = [object Object]
== CALLING JAVASCRIPT ==

function () {
try {
return entry0(jsFunction, this, arguments);
}
catch (e) {
throw e;
}
}

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

Discussion

  • Frank Lin

    Frank Lin - 2010-07-16
     
  • Marc Guillemot

    Marc Guillemot - 2010-07-19

    I'm not able to get this exception with latest sources from SVN. What did you do? Is this bug a regression for you since latest release?

    I guess that the event is not fired because content type of upload response is not html. In this case it is a valid bug but not a regression as it has never been working with other content types.

     
  • Amit Manjhi

    Amit Manjhi - 2010-07-22

    The fileUpload test failing in FormPanelTest is certainly a regression. Frank can provide additional details.

     
  • Frank Lin

    Frank Lin - 2010-07-23

    Here is the tiny case: Firefox returned "text="; HtmlUnit returned
    "text=null"

    <html> <head>
    <script type="text/javascript">
    function init() {
    alert("text=" + getContents(parent.document.body.lastElementChild));
    }

    function getContents(iframe) {
    try {
    if (!iframe.contentWindow || !iframe.contentWindow.document) {
    return null;
    }
    return iframe.contentWindow.document.body.innerHTML;
    } catch (e) {
    alert("exception occured");
    return null;
    }
    }

    </script>
    </head>
    <body onload="init();"><iframe tabindex="-1" style="position: absolute; width: 0pt; height: 0pt; border: medium none;" id="hello" src="javascript:''"></iframe><form name="f1" action="http://www.corp.google.com/~flin/war/hello/formHandler" enctype="multipart/form-data" method="post" target="FormPanel_hello_1"><input name="file0" class="gwt-FileUpload" type="file"></form><iframe id="last" src="javascript:''" name="FormPanel_hello_1" style="position: absolute; width: 0pt; height: 0pt; border: 0pt none;"></iframe><body></html>

     
  • Marc Guillemot

    Marc Guillemot - 2010-07-23

    @Amit: I've tested both the HelloApp and the tiny test case with latest sources from SVN, release 2.7 and release 2.6 => same results. Therefore I don't see why how it could be a regression. But this is a bug, what is bad enough ;-)

     
  • Ahmed Ashour

    Ahmed Ashour - 2010-08-14

    Reopening, it this is a bug, which should be fixed.

    @Frank: is this resolved from your side?

     
  • Ahmed Ashour

    Ahmed Ashour - 2012-07-25

    Now fixed in SVN. Thanks for reporting.

     

Log in to post a comment.