Junit GWT error - Cannot find function attachEvent in object [object Window]
I 开发者_如何学Ctry to create junit test for my GWT application. The application uses MathJax javascript library. I encounter an error that seems to be connected with javascript code.
The listing of the full error message is here.
I think that the core (main cause) of the error could be the following:
TypeError: Cannot find function attachEvent in object [object Window]. (http://192.168.1.10:50987/com.qtitools.player.Player.JUnit/MathJax/MathJax.js#987) (http://192.168.1.10:50987/com.qtitools.player.Player.JUnit/com.qtitools.player.Player.JUnit.nocache.js#530)
What could be the reason for not finding the attachEvent function? Thanks for any hints on how to fix this issue.
The problem is the HtmlUnit library does not support attachEvent
function properly while running test in FF emulator. The solution is to run tests only in IE7 emulator.
To achieve that open in eclipse add -Dgwt.args="-runStyle HtmlUnit:IE7"
to VM arguments.
精彩评论