GWTTestcase accessing javascript object defined in an external javascript file fails
I have defined a GWT module that includes an external javascript file using tag. I have written a GWTTestCase that returns the above described module's name. When my testcase accesses a javascript object I see 开发者_如何学Pythonthe following exception
Caused by: com.google.gwt.core.client.JavaScriptException: (null): null
Any idea on how to fix this?
Am I right in assuming that the scripts included in the gwt module definition file will be available when executing the GWTTestCase?
I have fixed it myself. Apparently, when accessing such objects it should be referenced using $wnd variable.
Example: test.js defined object test. In order to access it from GWT one should use, $wnd.test
Hope this answers saves somebody else' time.
精彩评论