From: Ahmed A. <asa...@ya...> - 2014-05-21 06:39:21
|
Hi Sridhar, The exception has all the details, Node.addEventListener() is being called with (String, NativeObject, Boolean), however, HtmlUnit expects (String, Function, Boolean). MDN hints that listener "must be an object implementing the EventListener interface, or simply a JavaScript function." [1]. With a quick search, I couldn't find an example of 'Object implementing EventListener", as all examples are Functions. You should be able to quickly search your JS for "addEventListener", and get a small test case which works in real browsers with a listener not of a Function type. Hope that helps, Ahmed [1] https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener ________________________________ From: sridhar kura <kur...@gm...> To: htm...@li... Sent: Wednesday, May 21, 2014 8:17 AM Subject: Re: [Htmlunit-user] com.gargoylesoftware.htmlunit.ScriptException: Exception invoking Node.addEventListener() with arguments [String, NativeObject, Boolean] Hi Team, I'm using latest HTMLUnit_2.14 jars, but I'm getting following expcetion.For more details about the exception please refer the attached doc. Can you guys help me what is the root cause of this exception and how to fix it? Also can you add the element details to the exception stack trace, which is causing the issue so that it would be easy to debug. On Sat, May 17, 2014 at 1:16 AM, sridhar kura <kur...@gm...> wrote: Hi Team, > >I'm using latest HTMLUnit_2.14 jars, but I'm getting following expcetion. Can you guys help me what is the root cause of this exception and how to fix it? Also can you add the element details to the exception which is causing the issue so that it would be easy to debug. > > >01:07:28,191 INFO [JavaScriptEngine] Caught script exception >======= EXCEPTION START ======== >Exception class=[java.lang.IllegalArgumentException] >com.gargoylesoftware.htmlunit.ScriptException: Exception invoking Node.addEventListener() with arguments [String, NativeObject, Boolean] > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:689) > |