Title: ScriptException due to unreferenced 'Event' Object

Hi,

in my html code I've got a portion of javacript that registers mouse events like :

  document.captureEvents(Event.MOUSEDOWN).

As far as I know, this step is required for Mozilla Browser in order to be notified about events. The 'Event' seems to be an appropriate reference to an object holding constants.Unfortunately, jWebUnit shows following Stacktrace when I try to access the page:

  com.meterware.httpunit.ScriptException: Script 'var IE = document.all?true:false; if (!IE) { document.captureEvents(Event.MOUSEDOWN); document.ca.....' failed: ReferenceError: "Event" is not defined. (httpunit; line 1) at     
  com.meterware.httpunit._javascript_._javascript_$_javascript_Engine.handleScriptException(_javascript_.java:202) at  
  com.meterware.httpunit._javascript_._javascript_$_javascript_Engine.executeScript(_javascript_.java:136) at
  com.meterware.httpunit.scripting.ScriptableDelegate.runScript(ScriptableDelegate.java:65) at  
  com.meterware.httpunit.ParsedHTML.interpretScriptElement(ParsedHTML.java:325) at

According to the stacktrace, jWebUnit assumes that 'Event' is a undeclared variable in my script.

How can I get work that with JWebUnit?

Thanks
/Kuno

Reply via email to