Hi,

the problem is not with the sleep: the js execution just fails.

Can you try with a recent htmlunit build? It contains a very large number of
improvements in js execution (both capabilities and speed).

Marc.


Andrew Sickorsky wrote:
> 
>>Are you sure that js is still executed after the step finished?
> Yes, I'm shure - this can be checked manually.
> 
>>In this case this would mean that this js code has been started in some
background job
> (with a window.setTimeOut for instance).
> exactly, scripts render data from XML in a background job
> 
>>What does happend when you use a sleep (with an exagerated long time to be
> sure to wait long enough)?
> Code:
> <clickLink label="Excel feed" description="click on Excel feed link"/>
> <sleep minutes="3"/>
> <verifyTitle text="Data analysis - View data" description="'Verify title
> is Data analysis - View data'"/>
> <clickLink label="Structure" description="Click link: Structure"/>
> 
> BTW table builds in a 10-15 seconds (in a browser), so 3 min is a good
> time to wait. Unfortunately this test fails on a <sleep> directly after
> starting it.
> Log:
> 
> clickLink
> 2007-07-12 15:41:02,417 [INFO,Step,main] >>>> Start Step: clickLink "click
> on Excel feed link" (16/41)
> 2007-07-12 15:41:02,417 [INFO,AbstractTargetAction,main] -> gotoTarget by
> clickLink
> 2007-07-12 15:41:04,441 [INFO,WebClientContext,main] Content of window
> changed to about:blank (text/html)
> 2007-07-12 15:41:04,441 [INFO,WebClientContext,main] Content of window
> changed with javascript, it will NOT become current response
> 2007-07-12 15:41:04,881 [INFO,WebClientContext,main] Content of window
> changed to
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> (text/html)
> 2007-07-12 15:41:04,881 [INFO,WebClientContext,main] Content of window
> changed with javascript, it will NOT become current response
> 2007-07-12 15:41:04,881 [INFO,WebClientContext,main] Content of window
> changed to
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/com.texunatech.services.gwt.analysis.Table.nocache.html?0&1184240464441
> (text/html)
> 2007-07-12 15:41:04,881 [INFO,WebClientContext,main] Content of window
> changed with javascript, it will NOT become current response
> 2007-07-12 15:41:07,956 [INFO,WebClientContext,main] Content of window
> changed to about:blank (text/html)
> 2007-07-12 15:41:07,956 [INFO,WebClientContext,main] Content of frame
> window has changed without javascript while enclosing page is loading, it
> will NOT become current response
> 2007-07-12 15:41:08,348 [INFO,WebClientContext,main] Content of window
> changed to http://localhost/services/123456/analysis/dataView/?tableId=1
> (text/html)
> 2007-07-12 15:41:08,348 [INFO,WebClientContext,main] Content of current
> window changed, it will become current response
> 2007-07-12 15:41:08,364 [INFO,WebClientContext,main] Current form set to
> none
> 2007-07-12 15:41:08,364 [INFO,WebClientContext,main] Current response now:
> http://localhost/services/123456/analysis/dataView/?tableId=1
> 
> sleep
> 2007-07-12 15:41:08,583 [INFO,JavaScriptEngine,HtmlUnit Managed Thread
> #27: window.setTimeout] Catched script exception
> ======= EXCEPTION START ========
> EcmaError: lineNumber=[1198] column=[0] lineSource=[null] name=[TypeError]
> sourceName=[Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0)] message=[TypeError: Cannot find function h.
> (Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0)#1198)]
> com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find
> function h. (Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0)#1198)
>       at
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:508)
>       at org.mozilla.javascript.Context.call(Context.java:528)
>       at org.mozilla.javascript.Context.call(Context.java:450)
>       at
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:421)
>       at
> com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:757)
>       at
> com.gargoylesoftware.htmlunit.javascript.host.JavaScriptBackgroundJob.run(JavaScriptBackgroundJob.java:112)
>       at java.lang.Thread.run(Thread.java:619)
>       at
> com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManager.java:118)
> Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot find
> function h. (Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0)#1198)
>       at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3229)
>       at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3219)
>       at
> org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3235)
>       at
> org.mozilla.javascript.ScriptRuntime.typeError1(ScriptRuntime.java:3247)
>       at
> org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3307)
>       at
> org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:1991)
>       at
> org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2932)
>       at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2251)
>       at
> org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:161)
>       at
> org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:340)
>       at
> com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:156)
>       at
> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2758)
>       at
> org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:159)
>       at
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:450)
>       at
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:415)
>       at
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:504)
>       ... 7 more
> Enclosed exception: 
> org.mozilla.javascript.EcmaError: TypeError: Cannot find function h.
> (Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0)#1198)
>       at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3229)
>       at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3219)
>       at
> org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3235)
>       at
> org.mozilla.javascript.ScriptRuntime.typeError1(ScriptRuntime.java:3247)
>       at
> org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3307)
>       at
> org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:1991)
>       at
> org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2932)
>       at script.DVb(Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0):1198)
>       at script.hWb(Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0):1201)
>       at script.vCb(Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0):940)
>       at script.xCb(Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0):941)
>       at script.ffb(Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0):695)
>       at script.ckb(Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0):724)
>       at script.iZb(Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0):1238)
>       at script.gwtOnLoad(Script in
> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
> from (10, 9) to (0, 0):1239)
>       at
> script(http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/gwt.js:295)
>       at
> script.__gwt_latchAndLaunch(http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/gwt.js:538)
>       at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2251)
>       at
> org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:161)
>       at
> org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:340)
>       at
> com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:156)
>       at
> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2758)
>       at
> org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:159)
>       at
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:450)
>       at
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:415)
>       at
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:504)
>       at org.mozilla.javascript.Context.call(Context.java:528)
>       at org.mozilla.javascript.Context.call(Context.java:450)
>       at
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:421)
>       at
> com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:757)
>       at
> com.gargoylesoftware.htmlunit.javascript.host.JavaScriptBackgroundJob.run(JavaScriptBackgroundJob.java:112)
>       at java.lang.Thread.run(Thread.java:619)
>       at
> com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManager.java:118)
> == CALLING JAVASCRIPT ==
> 
> 
>   function __gwt_latchAndLaunch() {
> 
>       var ready = true;
> 
>       if (ready && !__gwt_moduleControlBlocks.isReady()) {
> 
>           ready = false;
> 
>       }
> 
>       if (ready && !__gwt_isHostPageLoaded) {
> 
>           ready = false;
> 
>       }
> 
>       if (ready) {
> 
>           __gwt_moduleControlBlocks.run();
> 
>       } else {
> 
>           window.setTimeout(__gwt_latchAndLaunch, __gwt_retryWaitMillis);
> 
>       }
> 
>   }
> 
> 
> ======= EXCEPTION END ========
> 
>> Are you sure that js is still executed after the step finished? In this
>> case
>> this would mean that this js code has been started in some background job
>> (with a window.setTimeOut for instance).
>>
>> What does happend when you use a sleep (with an exagerated long time to
>> be
>> sure to wait long enough)? If some background js processing is beeing
>> processed, then it should have time to finish.
>>
>> In your example, which step fails? The verifyTitle?
>>
>> Marc.
>>
>>
>> Andrew Sickorsky wrote:
>>   
>>> Sorry for disturbing :-)
>>> It seems that problem is in GWT scripts: they should build table itself 
>>> after invoking a page. In this case two steps needed for test to 
>>> continue execution:
>>> 1) page with script loads
>>> 2) table builds via JS
>>> But for such scenario:
>>> <clickLink label="Excel feed" description="click on Excel feed link"/>
>>> <verifyTitle text="Data analysis - View data" description="'Verify title 
>>> is Data analysis - View data'"/>
>>> seems that table doesn't build properly.
>>> so - is any way to WAIT while JS finished it's work on building the 
>>> table? <sleep> step seems doesn't work in this case.
>>>
>>>
>>> Regards
>>> Andrew
>>>     
>>>> Hello all!
>>>>
>>>> I've testing our application partly based on GWT (especially GWT 
>>>> table). Sometimes I get an error message about exception
>>>> "EcmaError: lineNumber=[1198] column=[0] lineSource=[null] 
>>>> name=[TypeError] sourceName=[Script in 
>>>> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
>>>>  
>>>> from (10, 9) to (0, 0)] message=[TypeError: Cannot find function h. 
>>>> (Script in 
>>>> http://localhost/services/gwt/com.texunatech.services.gwt.analysis.Table/85994E5D93763735D31CE9DF5D0B14D4.cache.html?0
>>>>  
>>>> from (10, 9) to (0, 0)#1198)]"
>>>>  Because of this exception I couldn't test a large part of our 
>>>> application (it is thrown by JS links, pop-ups, etc). May be someone 
>>>> experience the same problem with GWT?
>>>>
>>>>
>>>>  Thanks in advance
>>>> Andrew
>>>> _______________________________________________
>>>> WebTest mailing list
>>>> [email protected]
>>>> http://lists.canoo.com/mailman/listinfo/webtest
>>>>       
>>> begin:vcard
>>> fn:Andrew Sickorsky
>>> n:Sickorsky;Andrew
>>> org:Texuna Technologies Ltd.
>>> email;internet:[EMAIL PROTECTED]
>>> title:Tester
>>> tel;cell:+7 909 9070328
>>> x-mozilla-html:TRUE
>>> url:www.texunatech.com
>>> version:2.1
>>> end:vcard
>>>
>>>
>>>
>>>     
>>
>>   
> 
> 
> begin:vcard
> fn:Andrew Sickorsky
> n:Sickorsky;Andrew
> org:Texuna Technologies Ltd.
> email;internet:[EMAIL PROTECTED]
> title:Tester
> tel;cell:+7 909 9070328
> x-mozilla-html:TRUE
> url:www.texunatech.com
> version:2.1
> end:vcard
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Script-exception-in-GWT---who-knows--tf4067167.html#a11645766
Sent from the WebTest mailing list archive at Nabble.com.

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to