[ http://webtest-community.canoo.com/jira/browse/WT-555?page=all ]
     
Marc Guillemot closed WT-555:
-----------------------------

    Fix Version: Future work
     Resolution: Fixed
      Assign To: Marc Guillemot

Fixed in build 1802.

> Javascript error terminates the test even when I have it switched off....
> -------------------------------------------------------------------------
>
>          Key: WT-555
>          URL: http://webtest-community.canoo.com/jira/browse/WT-555
>      Project: WebTest
>         Type: Bug

>     Versions: 3.0
>  Environment: Windows XP
>     Reporter: Mark Winney
>     Assignee: Marc Guillemot
>      Fix For: Future work
>  Attachments: onlineopinion.js
>
> I have set the javascript error indicator to false, but still get javscript 
> errors that terminate the test.
> My webtest sets the following in the config section
>                       <option name="ThrowExceptionOnScriptError" 
> value="false"/>
> But still get following stack trace and termination of the test
> [clickLink]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step: clickLink 
> "Navigate to Customer Service screen" (27/29)
> [clickLink]  INFO (com.canoo.webtest.engine.Configuration$2) - Caught script 
> exception
> [clickLink] ======= EXCEPTION START ========
> [clickLink] EcmaError: lineNumber=[1] column=[0] lineSource=[<no source>] 
> name=[ReferenceError] sourceName=[JavaScriptBackgroundJob] 
> message=[ReferenceError: "O_CommentMove" is not defined. 
> (JavaScriptBackgroundJob#1)]
> [clickLink] com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: 
> "O_CommentMove" is not defined. (JavaScriptBackgroundJob#1)
> [clickLink]   at 
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:513)
> [clickLink]   at org.mozilla.javascript.Context.call(Context.java:515)
> [clickLink]   at 
> org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
> [clickLink]   at 
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:412)
> [clickLink]   at 
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:387)
> [clickLink]   at 
> com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:934)
> [clickLink]   at 
> com.gargoylesoftware.htmlunit.JavaScriptBackgroundJob.run(JavaScriptBackgroundJob.java:101)
> [clickLink]   at java.lang.Thread.run(Unknown Source)
> [clickLink]   at 
> com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManager.java:116)
> [clickLink] Caused by: org.mozilla.javascript.EcmaError: ReferenceError: 
> "O_CommentMove" is not defined. (JavaScriptBackgroundJob#1)
> [clickLink]   at 
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)
> [clickLink]   at 
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)
> [clickLink]   at 
> org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3717)
> [clickLink]   at 
> org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2123)
> [clickLink]   at 
> org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3134)
> [clickLink]   at 
> org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
> [clickLink]   at 
> org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
> [clickLink]   at 
> org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
> [clickLink]   at 
> com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:192)
> [clickLink]   at 
> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
> [clickLink]   at 
> org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
> [clickLink]   at 
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:403)
> [clickLink]   at 
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:507)
> [clickLink]   ... 8 more
> The Configuration.java file contains the following class, which may need to 
> be rewritten
>       protected void setupWebClient()
>       {
>               WebClient webClient = createWebClient();
>               webClient = 
> fContext.getWebtest().getWebtestCustomizer().customizeWebClient(webClient);
>               fContext.setWebClient(webClient);
>               // catcher for JS background errors (as long as HtmlUnit 
> doesn't provide a better solution to handle this)
>       final Thread mainThread = Thread.currentThread();
>         final JavaScriptEngine myEngine = new JavaScriptEngine(webClient) {
>             private static final long serialVersionUID = 3410982366939766502L;
>             protected void reportJavaScriptException(final ScriptException 
> scriptException) {
>                               if (Thread.currentThread() != mainThread) {
>                       fContext.setBackgroundJSError(scriptException);
>               }
>                 super.reportJavaScriptException(scriptException);
>             }
>         };
>         webClient.setJavaScriptEngine(myEngine);
>       }
> Attached is the offending javascript file which is not pretty and contains 
> many timers.
> Thanks

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://webtest-community.canoo.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

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

Reply via email to