From: Erskine, C. <chr...@ed...> - 2005-02-24 15:25:16
|
Often this may mean that you have a bug in your JS which looks like it works or may use a bug within the browser to work but does not work with the standard DOM. Try running this in your browser with errors turned on to see if it complains. Also look at the HtmlUnit web site to see how to help debug JS problems. If you still can not find it, try building a jUnit testcase that will duplicate the problem. You can capture the HTML source from your browser to get the JSP and Struts artifacts out of the code and then reduce the HTML to the least amount that still produces the error. Chris Erskine EDS Consulting Services Colorado Springs, CO Phone: 719-265-5962 Cell: 719-640-6488 > -----Original Message----- > From: htm...@li... [mailto:htmlunit-user- > ad...@li...] On Behalf Of Jeff Marendo > Sent: Thursday, February 24, 2005 7:45 AM > To: htm...@li... > Subject: [Htmlunit-user] Javascript Errors > > Hello, > > I'm using HtmlUnit and have run into a problem that is related to the > interaction between the software and our usage of JavaScript. I've > stepped > through our application, HtmlUnit and Rhino source code using the debugger > in WebSphere Studio Application Developer 5.1.0, and I'm getting an > EvaluatorException at runtime like so: > > org.mozilla.javascript.EvaluatorException: The undefined value has no > properties. > > It is caught in the execute(HtmlPage, String, String, HtmlElement) method > of > the JavaScriptEngine class, but I think it might actually be occurring in > either the evaluateReader(Scriptable, Reader, String, int, Object) or > evaluteString(Scriptable, String, String, int, Object) method of the > org.mozilla.javascript.Context class. I realize that class is part of the > Rhino distribution, but I'm posting this message b/c of information I > found > in this link: > > http://sourceforge.net/mailarchive/message.php?msg_id=7662863 > > indicated that the exception "...is a fairly generic symptom that means > "some javascript object that you"re trying to use hasn"t been implemented > yet". The trick is to discover what javascript host object you"re > referencing so that we can implement it (or at least stub it out as a > temporary fix)...". > > The script that is being executed is pasted below: > > function submittingToCms() { > var i, numEls = document.cmsForm.elements.length; > for(i=0; i<numEls; i++) { > document.cmsForm.elements[i].disabled = false; > } > document.cmsForm.elements.sendButton.disabled = true; > } > > It is executed after posting from an HTML form using a submit button like > so: > > <html-el:form action="/cms/update" focus="${focusField}" > onsubmit="return submittingToCms();" > styleId="cmsForm"> > ... > </html-el:form> > > The script is embedded within the page that contains the form, and that > page > has a number of Struts (version 1.1) tags from the struts-html-el.tld and > struts-html.tld libraries. I'm not sure if that is part of the problem or > not. > > We don't have a public server to access to try to troubleshoot the problem, > but I'm hoping someone might be able to help without that. I've included > a > simplified view that shows the general sequence of classes and methods > that > I stepped through until the exception was thrown. I can provide more > information as necessary. Please take a look and share your ideas for how > I > can work through this problem. We stopped using jWebUnit b/c it couldn't > handle our JavaScript, which I think is minimal and straightforward > (compared to other apps on which I've worked!), and switched to HmtlUnit > b/c > of the greater support it offers. > > Thank you. > > Jeff > > Debugging Steps: > 1. org.mozilla.javascript.Context > - evaluateReader(Scriptable, Reader, String, int, Object) > > 2. org.mozilla.javascript.gen.c196 (could not be found) > > 3. org.mozilla.javascript.Context > - evaluateReader(Scriptable, Reader, String, int, Object > > 4. org.mozilla.javascript.Context > - evaluateString(Scriptable, String, String, int, Object) > - evaluateReader(Scriptable, Reader, String, int, Object) > > 5. com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine > - execute(HtmlPage, String, String, HtmlElement) > > 6. com.gargoylesoftware.htmlunit.html.HtmlPage > - executeJavaScriptIfPossible(String, String, boolean, HtmlElement) > > 7. org.mozilla.javascript.Context > - evaluateReader(Scriptable, Reader, String, int, Object) > > 8. org.mozilla.javascript.gen.c197 (could not be found) > > 9. com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine > - execute(HtmlPage, String, String, HtmlElement) ---> Throwable: > org.mozilla.javascript.EvaluatorException: The undefined value has no > properties. > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user |